dimsuz
12/03/2021, 5:35 PMFlow<T>
what would be the most idiomatic way to to the following:
someFlow.collect { v ->
process(v)
if (isVeryFirstItem) {
someSharedFlow.emit("received first item")
}
}
I.e. I want to do a side-effect only once after receiving the first emission. I could make isVeryFirstFirstItem
some kind of a volatile or AtomicBoolean, but somehow I don't like this.Victor Rendina
12/03/2021, 6:04 PMdimsuz
12/03/2021, 6:12 PM