Sam Stone
06/28/2023, 7:33 AMemptyFlow<T>()
returns a flow that can’t be emitted to, can’t be collected, neither, or is equivalent to flowOf<T>()
(just like how listOf<T>()
is in usage equivalent to emptyList<T>()
) but can be emitted to/collected from? The correct answer is: can’t be collected. I think this is counter-intuitive.ephemient
06/28/2023, 11:00 AMemptyFlow<Unit>().collect { error("never runs") }
flowOf<Unit>().collect { error("never runs") }
have the same resultephemient
06/28/2023, 11:02 AM