Home > @jsplumbtoolkit/browser-ui > getsert
getsert() function
Get, or insert then get, a value from the map.
Signature:
export declare function getsert<K, V>(map: Map<K, V>, key: K, valueGenerator: () => V): V;
Parameters
Parameter | Type | Description |
---|---|---|
map | Map<K, V> | Map to get the value from. |
key | K | Key of the value to retrieve |
valueGenerator | () => V | Method used to generate a value for the key if it is not currently in the map. |
Returns:
V