derived
Creates a StateFlow that computes its value based on other StateFlows via an autoRun block.
This behaves like SharingStarted.Eagerly and computes the initial value by executing the observer function immediately.
Creates a StateFlow that computes its value based on other StateFlows via a suspendable coAutoRun block.
You can use this to compute values on-demand only via SharingStarted.WhileSubscribed.
Parameters
The initial value (until the first computation finishes).
When the value should be updated. Pass SharingStarted.WhileSubscribed to compute only on demand. Defaults to SharingStarted.Eagerly.
The CoroutineLauncher to use.
How changes should be executed/collected. Defaults to conflatedWorker.
The CoroutineDispatcher to use. Defaults to dispatchers.main
.
Tracks loading state for the (re-)computation. Defaults to CoroutineLauncher.loading if this is a CoroutineLauncher or null
otherwise.
The callback which is used to track the observables.