onCondition

fun onCondition(test: () -> Boolean, block: StateAction.() -> Unit)(source)

When test first returns true while this state is active, run block. Each level has its own independent condition.