4 ms·
Redux to me is the most exciting part of patterns like Flux. Specifically the idea of immutable state where to change the state you replace the current state wi
by sktrdie 11y ago
Redux to me is the most exciting part of patterns like Flux. Specifically the idea of immutable state where to change the state you replace the current state with a new object. This allows to do really cool things such as undo/redo of actions. Check this simple video out to understand the power of Flux + immutable state: https://www.youtube.com/watch?v=jWq_3EH_mpg&feature=youtu.be https://www.youtube.com/watch?v=jWq_3EH_mpg&feature=youtu.be
- 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.