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

V2 - Add undo() and redo() on useParcelBuffer / useParcelForm #277

Open
dxinteractive opened this issue Jan 15, 2020 · 1 comment
Open

Comments

@dxinteractive
Copy link
Collaborator

We're storing all the users actions as actions in a stack anyway, so this shouldn't be difficult.

  • sort out what to do post-submit to retain ability to still undo
    • send changes but dont store them in state?
    • send changes as normal but keep old change requests in buffer to go back through?
  • keyboard bindings for Ctrl+Z as an optional thing would be great
@dxinteractive
Copy link
Collaborator Author

dxinteractive commented Jan 21, 2020

  • Simplify buffer by storing an array of actions (or objects that contain actions, which could also contain snapshots), not a change request
  • Do not clear buffer on submit, do it on receipt of new data
    • New data should perform a setData and just push it onto the stack, rather than replacing
  • Store an index of the active action (0 or less) to support redos
  • Add a history param that sets the minimum number of actions to remember

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

No branches or pull requests

1 participant