Hey, I'm the author of this library. It's definitely inspired by mori (and clojure and Haskell) and the reason I ended up building something different was to present a more JavaScript friendly API (and academically, to learn about HAMT). I've built this over the last couple weeks, and we are not using it internally yet - but I wanted to ensure development of it happened in public.
There is also Mori[1], a JavaScript API for using ClojureScript's persistent data structures:<p><pre><code> [1] http://swannodette.github.io/mori/</code></pre>
The original npm package "immutable" was <a href="https://github.com/hughfdjackson/immutable" rel="nofollow">https://github.com/hughfdjackson/immutable</a> (npm install immutable@1.4)<p>Did Facebook buy the npm name from hughfdjackson, did he give it to them, or did NPM switch ownership?
If anyone is interested in functional collections for Common Lisp or Java, have a look at FSet: <a href="http://www.ergy.com/FSet.html" rel="nofollow">http://www.ergy.com/FSet.html</a>
So you can use the Clojurescript/Om/Reagent/React model without Clojurescript, nice for people who don't want or can't jump into Clojurescript right now.
I wish the README would tell us a little bit more about how to use it in conjunction with React. Especially the logic for shouldComponentUpdate() would be interesting.
I have to admit, I find it odd that we name immutable data structures based on what they don't do instead of what they do.<p>Of course, what they do is <i>efficient persistence</i>. You want a snapshot of the data? You want a non-volatile reference? You've already got one! <i>That's</i> the feature. They should be called persistent data structures.
React's documentation also discuss their immutability helpers [1]. This new library looks like a better way of implementing this though. Will the documentation be amended to discuss use of immutable-js?<p>[1] <a href="http://facebook.github.io/react/docs/update.html" rel="nofollow">http://facebook.github.io/react/docs/update.html</a>
Also relevant (and not included in this collection) is the following functional red-black tree implementation:<p><a href="https://github.com/mikolalysenko/functional-red-black-tree" rel="nofollow">https://github.com/mikolalysenko/functional-red-black-tree</a>
Can someone give me a good example of where immutable data structures are better than mutable ones. I know that you are more likely to mess up and have side effects with mutable data structures, but so far all I have heard is theory.
What's the use of immutable data collections if you have to constantly revert to mutable arrays to render anything? Any gain from the persistent collection is lost in wasteful Array creating (Poor gc)