given

infix fun given(condition: (S) -> Boolean): EventTransitionBuilder<S, E, T>

Adds a guard condition to the transition.

Example:

on TimerExpired given { state -> state.timeRemaining <= 0 } becomes Yellow