js-util

Home > rc-js-util > mapClearingDeleteFromSet

mapClearingDeleteFromSet() function

Used with maps that store sets. Where a set exists for a given key the value will be removed from that set, if it is empty after removal, then the set is deleted.

Signature:

export declare function mapClearingDeleteFromSet<TKey, TValue>(map: Map<TKey, ISetLike<TValue>>, key: TKey, value: TValue): boolean;

Parameters

Parameter Type Description
map Map<TKey, ISetLike<TValue>> The Map to check. May be modified.
key TKey The key to lookup in map.
value TValue The value to remove.

Returns:

boolean

true - If value was removed.

Remarks

See mapDeleteFromSet().