Welshman Docs / @welshman/lib / cached
Function: cached() ​
cached<
T
,V
,Args
>(__namedParameters
): {(...args
):NonNullable
<V
>;cache
:LRUCache
<T
,V
>;getKey
: (args
) =>T
;getValue
: (args
) =>V
; }
Defined in: packages/lib/src/LRUCache.ts:46
Creates a memoized function with LRU caching
Type Parameters ​
T ​
T
Cache key type
V ​
V
Cache value type
Args ​
Args
extends any
[]
Function argument types
Parameters ​
__namedParameters ​
getKey ​
(args
) => T
getValue ​
(args
) => V
maxSize ​
number
Returns ​
(...
args
):NonNullable
<V
>
Parameters ​
args ​
...Args
Returns ​
NonNullable
<V
>
cache ​
cache:
LRUCache
<T
,V
>
getKey() ​
getKey: (
args
) =>T
Parameters ​
args ​
Args
Returns ​
T
getValue() ​
getValue: (
args
) =>V
Parameters ​
args ​
Args
Returns ​
V