useSingletonCache.d.ts 268 B

123456
  1. export type GetCache<T, R> = (cacheKeys: T, callback: () => R) => R;
  2. /**
  3. * Singleton cache will only take latest `cacheParams` as key
  4. * and return the result for callback matching.
  5. */
  6. export default function useSingletonCache<T extends any[], R>(): GetCache<T, R>;