typedash
Version:
modern, type-safe collection of utility functions
12 lines (9 loc) • 469 B
text/typescript
import { A as AnyFunction } from '../AnyFunction-DuIh5Fcc.cjs';
/**
* Memoizes a function.
* @param fn The function to memoize.
* @param cacheKeyResolver An optional function used to resolve the cache key. Defaults to the first argument in the function call.
* @returns The memoized function.
*/
declare function memoize<TFunction extends AnyFunction>(fn: TFunction, cacheKeyResolver?: (...args: Parameters<TFunction>) => string): TFunction;
export { memoize };