4 ms·
React's documentation also discuss their immutability helpers [1]. This new library looks like a better way of implementing this though. Will the documentation
by colinramsay 12y ago
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?
[1] http://facebook.github.io/react/docs/update.html http://facebook.github.io/react/docs/update.html
- vjeux 12y agoReact immutability helpers pros: - Work on regular JavaScript Object and Array so it's easy to get started and integrate to your app - You don't need to wrap objects inside of Immutable to use it and you can use `obj.key` and `arr[0]` syntax for accessing them instead of `obj.get('key')` and `arr.get(0)` cons: - There are no safe-guards if you mutate the objects and it'll likely break your app in subtle ways. This kind of discipline is very hard to get in big projects - You are stuck with primitive data structures (instead of map hash trie), so it's not going to be as performant and memory efficient.