Skip to content

Welshman Docs / @welshman/lib / simpleCache

Function: simpleCache() ​

simpleCache<V, Args>(getValue): (...args) => NonNullable<V>

Defined in: packages/lib/src/LRUCache.ts:79

Creates a simple memoized function with default settings

Type Parameters ​

• V

Cache value type

• Args extends any[]

Function argument types

Parameters ​

getValue ​

(args) => V

Returns ​

Function

Parameters ​

args ​

...Args

Returns ​

NonNullable<V>

cache ​

cache: LRUCache<string, V>

getKey() ​

getKey: (args) => string

Parameters ​

args ​

Args

Returns ​

string

getValue() ​

getValue: (args) => V

Parameters ​

args ​

Args

Returns ​

V