Merge different consecutive action types #82
Replies: 1 comment
-
Hi @stijnvanbossuyt, I see your point and I've also been thinking that the current configuration API could be more flexible. E.g. the merge predicates defined currently by Taking this thought further, this could also apply to Would you be able to contribute to such an API change? You might also be able to workaround the current limitation by adding an effect to your application which emits another undo/redo action depending on the last action that was undone/redone. You can get this information via the |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a scenario where a have multiple actions mutating the state consecutively. Due to reusability of these actions they have been split up.
I have the following 2 scenario's:
Action: setQuestion
Action: setProperty
Action: setSubQuestion
Action: setProperty
To undo this I have to run the Undo action twice. Is it possible to define a merge strategy where I can define these actions as one state change?
For example something like this:
mergeStrategy: [ ['setQuestion', 'setProperty'], ['setSubQuestion', 'setProperty'], ]
Thanks
Beta Was this translation helpful? Give feedback.
All reactions