Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to batch undos? #117

Open
xn opened this issue Jan 20, 2017 · 4 comments
Open

Is there a way to batch undos? #117

xn opened this issue Jan 20, 2017 · 4 comments

Comments

@xn
Copy link

xn commented Jan 20, 2017

I've spent a few days getting this integrated on a relatively large and complex project and have a ton of questions, but for right now...

Is there a way to batch undos?

Thanks

@offirgolan
Copy link
Owner

What do you mean by doing batch undos?

@xn
Copy link
Author

xn commented Jan 20, 2017

So, the problem I'm having is that a single action might generate 10-15 changes. I want to undo the action en masse, not have to click 'undo' 10-15 times. I see in the source code that you can send a numUndos value which I could fill if I kept some elaborate bookkeeping of every mutation, but I don't think that's feasible. Again, looking at the source code, I see that the answer is probably not, but have you thought of this use case or have any ideas on how to sanely address this?

@offirgolan
Copy link
Owner

offirgolan commented Jan 20, 2017

@xn The only thing I can think of is using undoAll with passing on and excludes.

@denzo
Copy link
Contributor

denzo commented Oct 9, 2017

@xn do you mean something like this? https://github.com/omnidan/redux-undo#grouping-actions

@offirgolan the use case we have is when we are moving an item in a list (change its index in array) we remove it from the array and then insert it in the new location which is when using this addon requires 2 undos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants