2 ms·
React 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
by vjeux 12y ago
React 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.