Re:Show HN: Redux-undo – Simple undo/redo functionality for ...
by europestup on Friday September 18, 2015 @01:51PM
(#10240818)
What about undoing on the server though? Doing that on the client only isn't very good useful in most situations I can think of.
[ Parent
| on HN ]
Re:Show HN: Redux-undo – Simple undo/redo functionality for ...
by omnidan on Friday September 18, 2015 @01:58PM
(#10240878)
That's an interesting question. The simplest way would be listening to state changes in the store and then syncing the state with the server. Since undos/redos are normal redux actions, you can just handle them like any other action in redux.
For example, in an application I wrote, I do `store.subscribe(autoSaveFunction)` which will automatically save all changes to the state. Of course, you can also only store parts of the state, etc, but this is more redux related than redux-undo related.