rnett
05/17/2024, 3:21 AMrnett
05/17/2024, 3:37 AMMutableStateFlow().onCompletion{ emitAll(sharedFlow) }
which loses the state flow typeGeert
05/17/2024, 11:58 AMsharedFlow.stateIn(someCoroutineScope)
?rnett
05/17/2024, 3:53 PMJoffrey
05/17/2024, 4:16 PMuli
05/17/2024, 5:55 PMpublic interface StateFlow<out T> : SharedFlow<T> {
/**
* The current value of this state flow.
*/
public val value: T
}
But it’s hard to get right. If look at google for implementations of `fun StateFlow.map(…):StateFlow`you will probably find some inspirationrnett
05/17/2024, 11:14 PMvalue
accessor was driving most of the problems, and I didn't actually need it (I just needed the initial value to pass into collectAsState
, so I went with that and just passed around the initial value and flow of updates