onActionEffect

inline fun <SubAction : A> onActionEffect(executionPolicy: ExecutionPolicy = ExecutionPolicy.CANCEL_PREVIOUS, noinline handler: suspend (action: SubAction, stateSnapshot: InputState) -> Unit)

An effect is a way to do some work without changing the state. A typical use case would be trigger navigation as some sort of side effect or triggering analytics. This is the "effect counterpart" to handling actions that you would do with on.

An ongoing handler is cancelled when leaving this state. executionPolicy is used to determine the behavior when a new SubAction is dispatched while the previous handler execution is still ongoing. By default an ongoing handler is cancelled when leaving this state or when a new SubAction is dispatched.