@epic-web/cachified
Version:
neat wrapper for various caches
6 lines (5 loc) • 479 B
TypeScript
import { Context, CacheEntry } from './common';
import { Reporter } from './reporter';
export declare const CACHE_EMPTY: unique symbol;
export declare function getCacheEntry<Value>({ key, cache }: Pick<Context<Value>, 'key' | 'cache'>, report: Reporter<Value>): Promise<CacheEntry<unknown> | typeof CACHE_EMPTY>;
export declare function getCachedValue<Value>(context: Context<Value>, report: Reporter<Value>, hasPendingValue: () => boolean): Promise<Value | typeof CACHE_EMPTY>;