matthewp / robot

🤖 A functional, immutable Finite State Machine library

Home Page:https://thisrobot.life

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass the event into the guard

benjixx opened this issue · comments

I have a state machine where I want a a transition only to occur when the event has a specific form, e.g. a provided value is in a specific range. My understanding is that guards would be the right approach here, but it looks like events are currently not passed to guards.

Hey, thanks for mentioning this. Should have this done soon. I noticed the event is also not passed into the context creator function for submachines. So I'm trying to align all of these functions to have the (ctx, ev) signature.

Accidentally closed 😬

This was implemented in 0.2.6. Thanks again for bringing it up!