currentStateAsState

Functions summary

State<Lifecycle.State>

Collects values from the Lifecycle.currentStateFlow and represents its latest value via State.

Cmn

Functions

Lifecycle.currentStateAsState

@Composable
fun Lifecycle.currentStateAsState(): State<Lifecycle.State>

Collects values from the Lifecycle.currentStateFlow and represents its latest value via State. The StateFlow.value is used as an initial value. Every time there would be new value posted into the StateFlow the returned State will be updated causing recomposition of every State.value usage.