4 ms·
It'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
by andy_ppp 11y ago
It'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.