with-simple-caching
Version:
A wrapper that makes it simple to add caching to any function
13 lines (12 loc) • 377 B
TypeScript
import { SimpleAsyncCache, SimpleSyncCache } from '../domain/SimpleCache';
export declare const createExampleSyncCache: () => {
cache: SimpleSyncCache<any>;
store: Record<string, any>;
};
export declare const createExampleAsyncCache: <T>() => {
cache: SimpleAsyncCache<T>;
store: Record<string, {
value: T;
options?: any;
} | undefined>;
};