Immutable.js provides Persistent Immutable List, Stack, Map, OrderedMap, Set, OrderedSet and Record. They are highly efficient on modern JavaScript VMs (browser and nodejs) by using structural sharing via hash maps tries and vector tries as popularized by Clojure and Scala, minimizing the need to copy or cache data.
Immutable
provides immutable data structures like List, Stack, Map, OrderedMap, Set
and Record
by using persistent hash maps tries and vector tries as popularized by Clojure and Scala
. They achieve efficiency on modern JavaScript VMs
by using structural sharing and minimizing the need to copy or cache data.
Immutable also provides a lazy Seq, allowing efficient chaining of collection methods like map and filter without creating intermediate representations. Create some Seq with Range and Repeat.
Getting started:
Install immutable using npm.
npm install immutable
Then require it into any module.
var Immutable = require('immutable');
var map = Immutable.Map({a:1, b:2, c:3});
Useful links:
License:
Immutable is BSD-licensed
. We also provide an additional patent grant
.