1.0.2 • Published 7 years ago

immutable-es6-map v1.0.2

Weekly downloads
7
License
SEE LICENSE IN LI...
Repository
github
Last release
7 years ago

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

1.0.2

7 years ago

1.0.0

7 years ago