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

Add the redo feature #206

Closed
bebraw opened this issue Apr 28, 2015 · 9 comments
Closed

Add the redo feature #206

bebraw opened this issue Apr 28, 2015 · 9 comments

Comments

@bebraw
Copy link
Contributor

bebraw commented Apr 28, 2015

Given there's undo already, it might make sense to briefly show a smart way to implement redo.

@Yomguithereal
Copy link
Owner

I was actually thinking to implement it into the library.

@bebraw
Copy link
Contributor Author

bebraw commented Apr 28, 2015

Yeah, that could be a nice solution.

@Yomguithereal Yomguithereal changed the title Add redo example to README Add the redo feature Sep 28, 2015
@Yomguithereal
Copy link
Owner

I am currently thinking of dropping the library's history helpers since I think it would be quite easy to implement it on your own outside of it (I would even create such an external library in fact).

@Yomguithereal
Copy link
Owner

@christianalfoni: does some Cerebral helpers or Cerebral itself uses the library's history helpers or does your state abstraction handle it on its own.

@stacklance
Copy link

If you are going to rewrite the history feature perhaps it would be worthwhile to consider doing isolated history rather than universal history as it is today. For example, given a unique ID, implement a transaction log.

This would be immensely helpful for example when chaining multiple mutations to modify some set of states. It would make it trivial to undo/redo a user action composed of several mutations atomically without contamination from mutations of other user actions that took place concurrently.

Example, two user actions invoked one after the other. They both modified some set of states individually. Now they both invoke ajax requests. The ajax request from the second user action returned before the ajax request from the first user action, and went on to modify some more state. Finally the first user action also completed. Now I want to undo the second user action but can't because I not have isolated transaction logs for each action's mutations.

Might be a separate library tho :)

@Yomguithereal
Copy link
Owner

Hello @stacklance. This was indeed my intention if I go the separate lib way. I don't integrate those features in the core lib because I don't want to make it bloated.

@Yomguithereal
Copy link
Owner

The thing I would like to know however is: does someone uses cursors' history right now? And, do I need to break to v3 to drop it.

@SaphuA
Copy link
Contributor

SaphuA commented Nov 9, 2015

@Yomguithereal My opinion is that if you provide an upgrade guide it shouldn't be much of an issue to introduce a new major version for a cool new feature.

@Yomguithereal
Copy link
Owner

The thing is the cool new feature would be part of an external lib while the new major version would just be somewhat the precedent version without some old features. Will first build such external lib and then see what I can do to advance.

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

4 participants