I don't think this block should accept any parameter. In any case, if needed, the state machine should return the object back (the object with state, Subscription in the examples) and not the StateMachine definition (as in the example)