cached<T extends (...args: A) => any, A extends any[]>( changed: (prevArgs: A, currentArgs: A) => boolean, run: T,): T & IClearable Type Parameters
- T extends (...args: A) => any
- A extends any[]
Parameters
- changed: (prevArgs: A, currentArgs: A) => boolean
- run: T
Returns T & IClearable
- The cached function with additional clear method.
Caches the result of a function based on the change of arguments.