Is it possible to iterate over `Flow` just like we...
# coroutines
r
Is it possible to iterate over
Flow
just like we can iterate over
ReceiveChannel
?
👌 1
🚫 1
How to iterate with
for
if
Flow
doesn't have
iterator()
method?
l
@Robert Jaros with
collect
g
semantics of for loop on Channel and collect are different. For loop do not ensure that channel is closed There is no
for
loop (and iterator) for Flow because you cannot just stop iterate on flow (how you can do with channel/iterator), you have to consume flow or cancel coroutine to avoid leak