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