cedux icon indicating copy to clipboard operation
cedux copied to clipboard

state should be immutable

Open davemackintosh opened this issue 6 years ago • 1 comments

One of the best features of Redux is the state is never actually modified, instead it is cloned and the clone is modified and returned as current state. This allows for the most helpful feature of time travel debugging where actions can be recorded and replayed to create a situation and tests. I may PR if I get time.

davemackintosh avatar Oct 03 '18 18:10 davemackintosh

Good point. Is your concern just that the state mutations don't happen atomically with the current implementation? With the current implementation, if an ISR were to fire during the cedux_run_x function and that ISR had a handle to the store, it's possible that it would access the store in an intermediary state. Is that what the issue you had in mind?

JSchaenzle avatar Oct 03 '18 18:10 JSchaenzle