4 ms·
> This allows to do really cool things such as undo/redo of actions. It makes it easier for sure, but undo/redo isn't dependent on immutability.
by robmcm 11y ago
> This allows to do really cool things such as undo/redo of actions.
It makes it easier for sure, but undo/redo isn't dependent on immutability.
- andy_ppp 11y agoIt's much more complicated to build a system that can do undo without immutability IMO. Redux requires that you never mutate the global state object and things tends to be faster on large numbers of operations/clonings if you use something like Immutable.js.
- deleted 11y ago[deleted]
- gambler 11y agoYou could store your state in DOM and serialize the entire page. Not very elegant, but it works and is relatively straightforward. Although, the mental leap required to represent your state via attributes is probably higher for most devs than even immutable data structures.
- andy_ppp 11y agoSounds prone to bugs and very slow to me.