Skip to content

SoftwarePlumbers/immutable-es6-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Immutable map maintaining maximum compatibility with ES6 Map

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published