In my application I use D3.js for some visualizations.
Now D3 works with mutable native JavaScript data structures.
So some data marshalling would be necessary for this to work with Immutable.js.
I also use Reflux with React, so in my Store I manage an Immutable Map. Since this Map becomes a new thing on every change I cannot just pass it to D3 Force Layout because that works with mutable data so each time it recalculates everything from scratch.
I end up with managing both immutable and mutable data structures but this feels very wrong.
I found an article, Practical Time Series Visualization using D3 + OM, which seems to touch on the subject and suggests to use Cursors. The problem is it uses Clojure(Script) when I'm using just JavaScript.
I understand this is very abstract without code examples but any suggestion on the subject of working/syncing both immutable and mutable data will be appreciated!
Object.freeze(obj)
in their source. Only time they return a new value is when you use immutable.js API methods on them. As you can see this way is a little of both, sometimes confusing. – Yellowbird