Adds an object to an existing map. It assumes a structure where each top-level property is a key:
import { Maps } from 'https://unpkg.com/ixfx/dist/data.js';const data = { Sally: { colour: `red` }, Bob: { colour: `pink` }};const map = new Map();Maps.addObject(map, data);map.get(`Sally`); // { name: `Sally`, colour: `red` } Copy
import { Maps } from 'https://unpkg.com/ixfx/dist/data.js';const data = { Sally: { colour: `red` }, Bob: { colour: `pink` }};const map = new Map();Maps.addObject(map, data);map.get(`Sally`); // { name: `Sally`, colour: `red` }
To create a new map from an object, use fromObject instead.
Adds an object to an existing map. It assumes a structure where each top-level property is a key:
To create a new map from an object, use fromObject instead.