- cached<T, A>(changed, run): T & IClearable
Type Parameters
- T extends ((...args: A) => any)
- A extends any[]
Parameters
- changed: ((prevArgs: A, currentArgs: A) => boolean)
- (prevArgs, currentArgs): boolean
Parameters
- prevArgs: A
- currentArgs: A
Returns 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.