Object index
Tired of looping through your array of objects or object of arrays? End with it, index it by key you want, query it like a database!
Install
$ npm i object-indexed-map
Example of usage
Take a look at the example or at the tests.
immutable.js
Support forTake a look at the tests again and look for immutable-driver
test.
warning in order for this to be working, you have to use immutable.Record
as immutable.Map
, because Record
implements getters!
.
The reason for this is that his library should not care how to get values from an object.
So it just uses native Javascript getters:
let value = objectkey
anything like:
let value = object
cannot be used.
So your tree must be defined as a immutable.Record
, which is easy and a good practice:
const Structure = immutable const Todo = immutable const Human = immutable const testTree =