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

on_enter_{state} does not excute automatically #6

Closed
ExpandOcean opened this issue Jan 15, 2015 · 5 comments
Closed

on_enter_{state} does not excute automatically #6

ExpandOcean opened this issue Jan 15, 2015 · 5 comments

Comments

@ExpandOcean
Copy link
Contributor

I found on_enter_{state} excute only if I set the on_enter=xxx in defination of state. I think the code below is natural, but it can not work. Do you think it should be supported?

image

@tyarkoni
Copy link
Member

It wouldn't take much work to add that behavior, but I'm not sure how I feel about it. Mainly I worry about feature creep if we start doing things like scanning the data model for already-defined callbacks, etc. It feels a bit inelegant to me to push some of the FSM logic into the data object. That said, I don't feel strongly about it, so let's leave this issue open for now, and if other people weigh in with strong opinions one way or the other, we can re-evaluate.

@mayowa
Copy link
Contributor

mayowa commented Mar 6, 2015

+1 I think it would a great idea for on_enter_ and on_exit_ methods to be detected in the model and executed during transitions, Methinks it would make the code a whole lot more readable

@tyarkoni
Copy link
Member

tyarkoni commented Mar 6, 2015

Okay, then I'm sold. Does someone want to take a stab at a PR? If not, I should be able to get to it in a few days.

@mayowa
Copy link
Contributor

mayowa commented Mar 6, 2015

I'll do it and send you a PR

@tyarkoni
Copy link
Member

tyarkoni commented Mar 6, 2015

Great!

mayowa added a commit to mayowa/transitions that referenced this issue Mar 7, 2015
mayowa added a commit to mayowa/transitions that referenced this issue Mar 7, 2015
tyarkoni added a commit that referenced this issue Mar 7, 2015
fixed #6: on_enter_{state} does not excute automatically
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

3 participants