Skip to content

Add undo/redo functionality #70

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

Closed
ecarriou opened this issue Dec 28, 2019 · 0 comments
Closed

Add undo/redo functionality #70

ecarriou opened this issue Dec 28, 2019 · 0 comments
Assignees

Comments

@ecarriou
Copy link
Member

ecarriou commented Dec 28, 2019

User need a way to go back/forward to the history of the system lifecycle. To do so, we need to create a history component with undo and redo APIs to navigate into the history of component state.

Proposed APIs

// get the history component
const history = runtime.require('history')

// start historization
history.start()

// go back in the history
history.from(-1) // set the cursor at the index we want, -1 means to start from the end of the history stack
history.back()

// go forward the in history
history.forward()

// dump the current history
const dump = history.dump()

// load an history and inject the modifications to the current system
history.load(dump)

// stop historization
history.stop()
@ecarriou ecarriou self-assigned this Dec 28, 2019
ecarriou added a commit that referenced this issue Dec 28, 2019
ecarriou added a commit that referenced this issue Dec 28, 2019
ecarriou added a commit that referenced this issue Dec 29, 2019
ecarriou added a commit that referenced this issue Dec 29, 2019
ecarriou added a commit that referenced this issue Dec 29, 2019
ecarriou added a commit that referenced this issue Dec 29, 2019
ecarriou added a commit that referenced this issue Dec 29, 2019
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