memoize
memoize<
A,B>(f,keyFn?): (a) =>B
Defined in: Composition/memoize.ts:27
Creates a memoized version of a function that caches results. Subsequent calls with the same argument return the cached result.
By default, uses the argument directly as the cache key.
For complex arguments, provide a custom keyFn to generate cache keys.
Type Parameters
Section titled “Type Parameters”A
B
Parameters
Section titled “Parameters”(a) => B
keyFn?
Section titled “keyFn?”(a) => unknown
Returns
Section titled “Returns”(
a):B
Parameters
Section titled “Parameters”A
Returns
Section titled “Returns”B