-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Undo/redo pattern? #88
Comments
Efficient undo / redo is very doable by tracking your state using immutable shared data structures. See for example the reactive 2015 demo which features time travelling and the createTransformer pattern that can be used to achieve patterns like these. (another approach is to record patches, see for example these packages: https://www.npmjs.com/package/mobservable-patch-stream https://www.npmjs.com/package/observable-delta-stream or the extras.trackTransactions api, although that is mainly for debugging) |
Aha, you just autorun your own serializer ... makes sense, thank you! Now I'd probably want to be able to diff two stored states so that upon undo, I can send a changeset to the server. Unfortunately the two npm packages you linked to (by @tetsuo) are dead ... any idea what happened to them? |
... actually, never mind: https://github.com/chbrown/rfc6902 would do the job just fine for me. |
@skosch @mweststrate Ah, |
Hey,
mobservable looks fanstastic – it certainly promises to be much less verbose than even the most concise Redux app. Still, I often do need to support undo/redo stacks. I'm aware of @mweststrate's experiments in #9, but it seems like that didn't go anywhere. If I needed a domain data store with undo-able actions, how should I go about it?
I've come across other non-Flux approaches that try to do this, e.g. https://github.com/omniscientjs/immstruct ... might there be a way of combining those ideas?
Many thanks again for sharing this project with the community!
The text was updated successfully, but these errors were encountered: