- Preparing search index...
- The search index is not available
Dappetizer
Class CacheMap<TKey, TValue>
Constructors
constructor
- new CacheMap<TKey, TValue>(options: {
itemFactory: ((key: TKey) => TValue);
stringifyKey: ((key: TKey) => string);
}): CacheMap<TKey, TValue>
-
Parameters
-
options: {
itemFactory: ((key: TKey) => TValue);
stringifyKey: ((key: TKey) => string);
}
-
itemFactory: ((key: TKey) => TValue)
-
- (key: TKey): TValue
-
Returns TValue
-
stringifyKey: ((key: TKey) => string)
-
- (key: TKey): string
-
Returns string
Returns CacheMap<TKey, TValue>
Methods
get
- get(key: TKey): TValue
-
Returns TValue
Compared to a Map with a helper method:
Deprecated
Use getOrCreate instead.