I'm using immutable.js with my flux application. It is very useful and gives performance boost. But what actually makes me sad is the fact that I can't use lodash together with it. Lodash provides great API with ton of useful functions, so I wonder maybe there is a way to get them together to work for me?
I'm assuming you're trying to do something like do a lodash map on an immutable set. Lodash doesn't do helpful things when you try to do that directly.
If you need to do something that
lodash provides and
immutable.js does not, one thing you can do is take your immutable object and convert it to a vanilla JS object for consumption by lodash.
// Do all of your fancy immutable.js stuff... my_set = immutable.Set([1,2,3]).union(immutable.Set([2,3,4])) // ...and then convert to JS before you do all of your fancy lodash stuff mapped_set = _(my_set.toArray()).map(whatever)
You'll of course have to take performance into account here, since you may end up with the worst of both worlds if you convert from one to the other by copying your data into a vanilla data structure. In the toy case above, for instance, you'd probably be better off using an immutable.js