immutable-es6-map

1.0.2 • Public • Published

Software Plumbers Immutable Map

Immutable map object maximally compatible with (and backed by) an ES6 Map

Summary

const TEST_DATA = ;

let map1 = new ImmutableMap([ 
	[ 'foo', 'bar' ], 
	[ 'dinkum', 'thinkum' ], 
	[ 'wyoming', 'knot' ], 
	[ 'dick', 'seaton' ] 
]);

// chain update operations
let map2 = map1.set('hercules', 'morse').delete('dinkum').set('dick','grayson');

// map1 is unchanged

The map API is the same as for the ES6 map with two notable exceptions; the clear() method is missing and the delete(key) operation returns a copy of the map (with item removed) rather than a true/false indicator of whether the remove was susccessful. The set operation also returns a copy of the map operated on (with the update applied) rather than a reference to the original map.

For the latest API documentation see The Software Plumbers Site

Readme

Keywords

Package Sidebar

Install

npm i immutable-es6-map

Weekly Downloads

7

Version

1.0.2

License

SEE LICENSE IN LICENSE

Last publish

Collaborators

  • softwareplumber