You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for this repo! Feature request—it’d be really nice if I could group actions in the history, so one or more get grouped in a single undo action.
An example use-case would be when an element’s position is stored in state along with other attributes and I might want a sequence of position changes to group together while other attribute updates would be individual states in the history.
In the meantime, my workarounds are either trying to manage additional state in a separate context (which solves a lot of the scenarios, but eventually gets dodgy) or I could switch to redux and use redux-undo, which allows you set a custom grouping function.
The text was updated successfully, but these errors were encountered:
Hey @mrcoles, thanks for the idea. I have to think about this some more :) Currently, react-undo-redo does not make any assumptions about how your actions look like. I.e., also not that they have a type property. I somewhat like that. I could keep it that decoupled. Maybe I (we) can come up with an API that would keep this logic outside of the main lib but would still allow for grouping (because I like the sound of that).
and it uses the return value as a groupBy key, unless the value is null, then it assumes it’s not grouping (IDK if undefined should be treated the same too?).
Hi, thanks for this repo! Feature request—it’d be really nice if I could group actions in the history, so one or more get grouped in a single undo action.
An example use-case would be when an element’s position is stored in state along with other attributes and I might want a sequence of position changes to group together while other attribute updates would be individual states in the history.
In the meantime, my workarounds are either trying to manage additional state in a separate context (which solves a lot of the scenarios, but eventually gets dodgy) or I could switch to redux and use redux-undo, which allows you set a custom grouping function.
The text was updated successfully, but these errors were encountered: