cspell-lib
Version:
A library of useful functions used across various cspell tools.
13 lines • 873 B
TypeScript
/**
* Create a function that memorizes the last call. If the next call is called with the same arguments, the
* the last value is returned.
* @param fn - function to memorize
* @returns a new function.
*/
export declare function memorizeLastCall<T>(fn: (...p: []) => T): (...p: []) => T;
export declare function memorizeLastCall<T, K0>(fn: (...p: [K0]) => T): (...p: [K0]) => T;
export declare function memorizeLastCall<T, K0, K1>(fn: (...p: [K0, K1]) => T): (...p: [K0, K1]) => T;
export declare function memorizeLastCall<T, K0, K1, K2>(fn: (...p: [K0, K1, K2]) => T): (...p: [K0, K1, K2]) => T;
export declare function memorizeLastCall<T, K0, K1, K2, K3>(fn: (...p: [K0, K1, K2, K3]) => T): (...p: [K0, K1, K2, K3]) => T;
export declare function memorizeLastCall<T, K>(fn: (...p: [...K[]]) => T): (...p: [...K[]]) => T;
//# sourceMappingURL=memorizeLastCall.d.ts.map