onTransition

var onTransition: (from: S, to: S) -> Unit?

Optional: Callback invoked on every state transition