leaving

fun leaving(action: (S) -> Unit)

Defines what happens when leaving this state.

Example:

leaving { state -> println("Left state") }