https://kotlinlang.org logo
#coroutines
Title
# coroutines
e

Eric Ampire [MOD]

07/31/2020, 11:08 AM
Hi to you, how can I call the emit method in the body of a lambda? Is that a good approach to the code on capture ?
w

wasyl

07/31/2020, 11:12 AM
I haven’t used firebase, but seems like you might want to use
callbackFlow { }
builder instead of
flow { }
☝️ 6
o

okarm

07/31/2020, 11:15 AM
g

Gabriel Feo

07/31/2020, 11:55 AM
Your problem there is that
emit
is a suspending function, and the lambda Firebase takes is not suspend. The
callbackFlow
as suggested will help you with this
e

Eric Ampire [MOD]

07/31/2020, 12:48 PM
Okay thanks
3 Views