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

previous state? #237

Closed
chrishough opened this issue Jun 22, 2023 · 2 comments
Closed

previous state? #237

chrishough opened this issue Jun 22, 2023 · 2 comments

Comments

@chrishough
Copy link

Before I consider adding a patch to the library, I was curious if we have ever considered having an instance method like current_state that would be previous_state?

@geekq
Copy link
Owner

geekq commented Jun 25, 2023

Nope, did not consider yet.
If you need it for your use case, you could use the on_transition hook https://github.com/geekq/workflow#on_transition to save the previous state to some instance variable.

@chrishough
Copy link
Author

Thank you @geekq we can use that!

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

No branches or pull requests

2 participants