Join Slack
Powered by
Would `prefs.data.onStart{ emit (initialPrefs) }` ...
# coroutines
u
uli
09/05/2021, 8:37 PM
Would
prefs.data.onStart{ emit (initialPrefs) }
do the job?
https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/on-start.html
c
Colton Idle
09/05/2021, 9:30 PM
It seems like that's a good way to set some initial value, but I still want the value to actually come from my source of truth, so I don't think just emitting a value is what I want here. I basically want this flow to be runBlocking{}?
u
uli
09/05/2021, 9:33 PM
Can you make your flow a StatFlow?
Open in Slack
Previous
Next