@actualwave/walker-denormalize-adapter
v0.0.3
Published
Tree Walker adapter for normalized trees
Downloads
7
Maintainers
Readme
Denormalize Adapter for TreeWalker
TreeWalker Adapter for normalized trees:
import { create } from '@actualwave/tree-walker';
import { createAdapter } from '@actualwave/walker-denormalize-adapter';
const store = {
entities: {
nodes: {
parent: {
value: 'parent value',
children: ['child'],
}
child: {
value: 'child value',
}
},
},
};
const root = create('parent', createAdapter(() => store.entities.nodes));
console.log(root.child.valueOf()); // { value: 'child value' }
Demo
You can check demo on jsfiddle.net.