Adds support for immutable-js without actually requiring it as a dependency.
Support is handled by using simple getIn, setIn methods that defer to the immutable implementations if the object is immutable otherwise implement the same behavior on plain javascript objects/arrays. immutable-js is required as a dev dependency since it's needed for specs. I just copied the existing specs and adapted them to work with immutable.
One thing to note (which I added to the README): Circular references is something that immutable-js does not support (and does not plan to support). When a circular reference is reached, the non-denormalized copy is returned. So:
// The nested article only contains a reference to the author by ID
denormalized.author.articles[0].author === 1
Adds support for immutable-js without actually requiring it as a dependency.
Support is handled by using simple
getIn
,setIn
methods that defer to the immutable implementations if the object is immutable otherwise implement the same behavior on plain javascript objects/arrays.immutable-js
is required as a dev dependency since it's needed for specs. I just copied the existing specs and adapted them to work with immutable.One thing to note (which I added to the README): Circular references is something that
immutable-js
does not support (and does not plan to support). When a circular reference is reached, the non-denormalized copy is returned. So: