rbt
v0.0.2
Published
Functional Red-Black Tree Map
Downloads
10
Maintainers
Readme
Pure-functional Red-Black Tree Map for JavaScript
rbt
is a bare-minimum implmentation of functional red-black tree in
JavaScript.
Usage
Node.js
npm install rbt
Then require it.
var rbtree = require('rbt');
var map1 = rbtree.fromObject({a:1, b:2, c:3});
var map2 = map1.set('b', 50);
map1.get('b'); // 2
map2.get('b'); // 50
Browser
<script src="dist/rbt.min.js"></script>
<script>
var map1 = rbtree.fromObject({a:1, b:2, c:3});
var map2 = map1.get('b',50);
map1.get('b'); // 2
map2.get('b'); // 50
</script>
Also see spec.
API
Use the source, Luke!
- static
fromObject
- static
empty
has
add
get
count
iter
map
reduce
toObject