SubscribeState

ISubscription IStateMachine.SubscribeState(System.Collections.IEnumerable<T> states, StateMachineStateHandler<T> handler)

Subscribes a callback to be executed when the state of the state machine changes to one of the specified states.

Parameters
  • states – States for which the callback is triggered.

  • handler – Delegate to be invoked when the state machine state changes to one of the specified states.

Returns

ISubscription – An ISubscription for the callback.

Throws
Remarks

If the state already matches one of the specified states, a callback is generated immediately.