/**
* Creates a memoized function. The returned function
* will only execute the source function when no value
* has previously been computed. If a ttl (milliseconds)
* is given previously computed values will be checked
* for expiration before being returned.
*/
declare const memo: <TFunc extends (...args: any) => any>(func: TFunc, options?: {
key?: Func<any, string>;
ttl?: number;
}) => TFunc;
The key option has its argument type set to any, but I believe it should be possible to infer its type from TFunc.
Here's the type definition for the
memo
function:The
key
option has its argument type set toany
, but I believe it should be possible to infer its type fromTFunc
.