@cedric-demongivert/immutable-tree

0.6.8 • Public • Published

Immutable Tree

build status coverage report

An immutable tree data-structure for web-components based frameworks.

Getting started

Install @rnp/immutable-tree using npm.

npm install @rnp/immutable-tree --save

Then import it and create a tree type :

import { ImmutableTree } from '@rnp/immutable-tree'

const MyTree = new ImmutableTree({
  'a': null,
  'b': 0,
  'c': 6
})

And enjoy the API.

let myTree = new MyTree()

myTree.set(['parent', 'child', 'sub-child', 'b'], 10)
console.log(myTree.get(['parent', 'child', 'sub-child', 'b'])) // 10

Package Sidebar

Install

npm i @cedric-demongivert/immutable-tree

Weekly Downloads

0

Version

0.6.8

License

MIT

Unpacked Size

24.7 kB

Total Files

5

Last publish

Collaborators

  • cedric-demongivert