onExit

fun onExit(block: StateAction.() -> Unit)(source)

Run block when this state is exited, after the state's triggers have been torn down and before the next state is entered. For composite states, substates exit first (bottom-up).