memoize<T extends (...args: A) => any, A extends any[], K = string>( key: (args: A) => K, run: T,): T & IClearable<K> & IControl<K, ReturnType<T>> Type Parameters
- T extends (...args: A) => any
- A extends any[]
- K = string
Parameters
- key: (args: A) => K
- run: T
- A memoized version of the original function with the ability to clear the cache
A memoization function that caches the result of a function based on its arguments.