onExit

fun onExit(action: (state: S) -> Unit)

Defines an action to run when exiting this state.

Parameters

action

The action to run