Home > rc-js-util > mapPush
Used with maps that store arrays. Where an array exists for a given key the value will be appended to that array, otherwise a new array will be created containing the value.
Signature:
export declare function mapPush<TKey extends object, TValue>(map: WeakMap<TKey, TValue[]>, key: TKey, value: TValue): void;
Parameter | Type | Description |
---|---|---|
map | WeakMap<TKey, TValue[]> | The Map to check. May be modified. |
key | TKey | The key to lookup in map . |
value | TValue | The value to push. |
Returns:
void
See mapPush().