Returns a IMapOfMutableExtended that uses a set to hold values.
This means that only unique values are stored under each key. By default it
uses the JSON representation to compare items.
Options: { hash: toStringFn } }
hash is a Util.ToString function: (object) => string. By default it uses
JSON.stringify.
Example: Only storing the newest three items per key
consthash = (v) =>v.name; // Use name as the key constmap = mapOfSetMutable(hash); map.add(`hello`, {age:40, name:`Mary`}); map.add(`hello`, {age:29, name:`Mary`}); // Value ignored as same name exists
Returns a IMapOfMutableExtended that uses a set to hold values. This means that only unique values are stored under each key. By default it uses the JSON representation to compare items.
Options:
{ hash: toStringFn } }
hash
is a Util.ToString function:(object) => string
. By default it usesJSON.stringify
.Example: Only storing the newest three items per key
Example