collectWhileInStateEffect

fun <T> collectWhileInStateEffect(flow: Flow<T>, executionPolicy: ExecutionPolicy = ExecutionPolicy.ORDERED, handler: suspend (item: T, state: InputState) -> Unit)
fun <T> collectWhileInStateEffect(flowBuilder: (InputState) -> Flow<T>, executionPolicy: ExecutionPolicy = ExecutionPolicy.ORDERED, handler: suspend (item: T, state: InputState) -> Unit)

An effect is a way to do some work without changing the state. A typical use case is to trigger navigation as some sort of side effect or triggering analytics or do logging.

This is the "effect counterpart" of collectWhileInState and follows the same logic when it triggers and when it gets canceled.