Immutable tree data-structure

Usage no npm install needed!

<script type="module">
  import cedricDemongivertImmutableTree from 'https://cdn.skypack.dev/@cedric-demongivert/immutable-tree';


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