collectAsState

@Composable
fun <STATE : Any, SIDE_EFFECT : Any> ContainerHost<STATE, SIDE_EFFECT>.collectAsState(lifecycleState: Lifecycle.State = Lifecycle.State.STARTED): State<STATE>

Observe Container.stateFlow as State.

Parameters

lifecycleState

The Lifecycle where the restarting collecting from this flow work will be kept alive.

Sources

Link copied to clipboard