https://github.com/burdiuz/js-walker-denormalize-adapter
https://github.com/burdiuz/js-walker-denormalize-adapter
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/burdiuz/js-walker-denormalize-adapter
- Owner: burdiuz
- License: mit
- Created: 2018-08-24T20:36:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-11T06:41:09.000Z (almost 7 years ago)
- Last Synced: 2025-03-17T19:48:50.915Z (3 months ago)
- Language: JavaScript
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Denormalize Adapter for TreeWalker
[TreeWalker](https://github.com/burdiuz/js-tree-walker) Adapter for normalized trees:
```javascript
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](https://jsfiddle.net/actualwave/5euz47hq/).