Closed iamgodot closed 1 year ago
I tried to say that this is a dynamic name interpolated with the event name.
For each action type you have a generic one, and other that is based or in the event name or in the state name.
For example, given that you have an event named finish
and and state completed
, something like this finish = pending.to(completed)
.
You can implement generic or named actions:
on_transition
(generic that will be called every time any transition occurs)on_finish
(the on_<event>
just for the finish
event)on_enter_state
(generic that will be called every time any state is entered)on_enter_completed
( the on_enter_<state.id>
just for the completed
state).I tried to say that this is a dynamic name interpolated with the event name.
For each action type you have a generic one, and other that is based or in the event name or in the state name.
For example, given that you have an event named
finish
and and statecompleted
, something like thisfinish = pending.to(completed)
.You can implement generic or named actions:
on_transition
(generic that will be called every time any transition occurs)on_finish
(theon_<event>
just for thefinish
event)on_enter_state
(generic that will be called every time any state is entered)on_enter_completed
( theon_enter_<state.id>
just for thecompleted
state).
Totally, thanks for the explanation. And I suppose it's better to use on_<event>()
instead of on_execute_<event>
, just like here, to keep things consistently. Let me know if you want this small update on the doc.
Oh, now I see 😃, it is a typo. Yes, thanks!
Oh, now I see 😃, it is a typo. Yes, thanks!
You're welcome :)
From here:
What does it mean by
on_execute_<event>
? Is it a typo or referring to something else?