memoize
| Generic types: | TFunc |
Memoizes a function with LRU cache eviction and optional custom cache key resolver.
Presentation
function memoize (
fn: TFunc,
resolverOrOptions?:
| ((...args: Parameters<TFunc>) => string)
| MemoizeOptions <TFunc>
| undefined,
): TFunc;Returns
TFunc -Memoized function
Parameters
| Name | Type | Description |
|---|---|---|
| fn | TFunc | Function to memoize |
| resolverOrOptions | ((...args: Parameters<TFunc>) => string) | | Optional key resolver function or options object |