observe

fun observe(observer: StateObserver<S>)

Adds an observer to the state machine.

Parameters

observer

The observer to add


fun observe(observer: (oldState: S, newState: S) -> Unit)

Adds an observer using a lambda.

Parameters

observer

The observer function