memoize
memoize<
A,B>(f,options?): (a) =>B
Defined in: Composition/memoize.ts:32
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
options?
Section titled “options?”(a) => unknown
maxSize?
Section titled “maxSize?”number
Maximum number of entries to store in the cache before evicting the least recently used (LRU) entry.
Returns
Section titled “Returns”(a) => B