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

Feature enhancement: reset action should empty the undo/redo stacks, but maintain/rebase the current state of the store/module at this point. #13

Closed
3 tasks
andrewbeng89 opened this issue Sep 3, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@andrewbeng89
Copy link
Member

andrewbeng89 commented Sep 3, 2019

This enhancement builds on from #7. The current clear action will empty the undo/redo stacks and set the state of the store when the emptyState mutation is committed. The new reset action should empty the undo/redo stacks, but still maintain the state of the store up to this particular point.

IS

  • given done: [mutationA, mutationB], undone: [mutationC], state: emptyState + mutationA, mutationB
  • when clear() is dispatched
  • then done: [], undone: [], state: emptyState

SHOULD

  • given done: [mutationA, mutationB], undone: [mutationC], state: emptyState + mutationA, mutationB
  • when reset() is dispatched
  • then done: [], undone: [], state: emptyState + mutationA, mutationB
@shurth
Copy link

shurth commented Jun 17, 2020

Not to be "that guy", but were you still thinking about implementing this @andrewbeng89? I was about to roll my own undo/redo plugin and ran into yours, but I'd need 'reset' capabilities so people couldn't undo the initial bootstrapping of the store.

@andrewbeng89
Copy link
Member Author

Hi @shurth thanks for you message. This feature is definitely on the roadmap for a future release. There are some minor complexities regarding how this feature will play well with actions/side-effects. Would you be interested to contribute to the development of this feature? We do need help with creating comprehensive test scenarios for this feature.

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

No branches or pull requests

2 participants