import { Maps } from 'https://unpkg.com/ixfx/dist/data.js'; Returns a Map from an iterable. By default throws an exception if iterable contains duplicate values.
const data = [ { fruit: `granny-smith`, family: `apple`, colour: `green` } { fruit: `mango`, family: `stone-fruit`, colour: `orange` }];const map = Maps.fromIterable(data, v => v.fruit); Copy
const data = [ { fruit: `granny-smith`, family: `apple`, colour: `green` } { fruit: `mango`, family: `stone-fruit`, colour: `orange` }];const map = Maps.fromIterable(data, v => v.fruit);
Input data
Function which returns a string id. By default uses the JSON value of the object.
A default converter to string that uses JSON.stringify if its an object, or the thing itself if it's a string
When set to true, items with same id will silently overwrite each other, with last write wins. false by default.
import { Maps } from 'https://unpkg.com/ixfx/dist/data.js'; Returns a Map from an iterable. By default throws an exception if iterable contains duplicate values.