You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to narrow the events according to the state:
if(actor.matches('State A')){actor.send({type: 'next'})actor.send({type: 'prev'})// <-- compile time error: we can't send event 'prev' from state 'State A'}if(actor.matches('State B')){actor.send({type: 'next'})// <-- compile time error: we can't send event 'next' from state 'State B'actor.send({type: 'prev'})}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Imagine having a state machine like this:
After creating an actor from that machine, we can send events:
It would be nice to narrow the events according to the state:
Beta Was this translation helpful? Give feedback.
All reactions