Constructors
constructor
- new Cache<Key, Value>(): Cache<Key, Value>
Type Parameters
Returns Cache<Key, Value>
Properties
Private map
map: Map<Key, Value>
Methods
get
- get(key: Key): undefined | Value
Parameters
Returns undefined | Value
getOrEmplace
- getOrEmplace(key: Key, defaultValueFactory: (() => Value)): Value
Parameters
key: Key
defaultValueFactory: (() => Value)
Returns Value
has
Parameters
Returns boolean
put
- put(key: Key, value: Value): void