zak.taccardi
12/07/2020, 5:50 PMsuspend function using something similar to .scan(..) with a SharedFlow?
.scan(loadInitialValueAsynchronously()) { .. }
I’m effectively trying to replace an actor with a SharedFlow.zak.taccardi
12/07/2020, 6:22 PMDeferred<SharedFlow<State> and emit that as `
flow { emitAll(deferredStateFlow.await()) }
seems a little un-ergonomic though? is there a better solution?zak.taccardi
12/07/2020, 6:29 PM.shareIn(
this,
SharingStarted.Eagerly, // begin observing immediately!
replay = 1
)
can be replaced with:
.stateIn(this)
which makes it a little nicer