redux-batched-actions icon indicating copy to clipboard operation
redux-batched-actions copied to clipboard

Combining with undo/redo

Open BrianHanechak opened this issue 7 years ago • 1 comments

Any thoughts on how this should be integrated with an undo/redo manager? My application is currently using an undo/redo manager for only one part of it's larger state object. It would be nice to have batched action not create two items in the undo history.

I think my current application may not have an issue because I generally want to batch one action that makes changes to undo/redo with other actions that do not.

BrianHanechak avatar Apr 06 '17 19:04 BrianHanechak

Can you describe your use-case a little more specifically? It's hard to make a general statement because batching can be done for a number of reasons.

In my projects, I use batching only for domain purposes - in other words, when the multiple changes taking place are a single semantic update, even if it takes running multiple reductions. In that case, undo / redo is philosophically the same, and the implementation depends on how your undo / redo functionality is handled.

Sometimes though, I can imagine batching actions simply for the purposes of performance, and that might not lend itself as nicely to undo / redo.

tshelburne avatar Apr 09 '17 20:04 tshelburne