UNPKG

promise-dedup

Version:
5 lines (4 loc) 260 B
export declare type Key = unknown[]; export declare type Stale = "never" | "settled" | number; export declare const cache: Map<string, PromiseLike<any>>; export declare function dedup<P extends PromiseLike<any>>(exec: () => P, key: Key, stale?: Stale): P;