return (...idAndOrParams) => {
    const keyGenerator: any =
      typeof pathOrGenerator === "function"
        ? encodeDynamicPath
        : encodeStaticPath

    const key = keyGenerator(pathOrGenerator, globalParams, ...idAndOrParams)
    return loader.load(key)
  }
Example #2
0
 load(key: Key): Promise<Entity> {
     return this.loader.load(key);
 }
export const getObjectFromUrl = async (url: string): Promise<any> => dataLoader.load(url);