launchMolecule

fun <T> CoroutineScope.launchMolecule(body: @Composable() () -> T): StateFlow<T>

Launch a coroutine into this CoroutineScope which will continually recompose body to produce a StateFlow stream of T values.

The CoroutineScope in which this StateFlow is created must contain a MonotonicFrameClock key which controls when recomposition occurs.

fun <T> CoroutineScope.launchMolecule(emitter: (T) -> Unit, body: @Composable() () -> T)

Launch a coroutine into this CoroutineScope which will continually recompose body to invoke emitter with each returned T value.

The CoroutineScope in which this StateFlow is created must contain a MonotonicFrameClock key which controls when recomposition occurs.