Is your intuition that `emptyFlow<T>()` retu...
# flow
s
Is your intuition that
emptyFlow<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.
e
what do you mean?
Copy code
emptyFlow<Unit>().collect { error("never runs") }
flowOf<Unit>().collect { error("never runs") }
have the same result
you cannot emit to either, they are not mutable nor system