I'm using these extensions to convert Flow from an...
# coroutines
j
I'm using these extensions to convert Flow from and to LiveData. After updating to coroutines 1.3 (RC2) this seems doesn't work as intented. Is it bug or am I missing something?
What's happening now is that invokeOnClose is immediately called.
l
@Jan Skrasek You need to replace
invokeOnClose { }
by
awaitClose { }
.
j
Thanks, it's working now! I'm thinking how exactly it works. 🤔
Oh, i see it. Channel suspends until channel is closed from outside. But if it didn't suspend, channelFlow would end and close itself. I'm I right?
g
Yes