Hi to you, how can I call the emit method in the ...
# coroutines
e
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
I haven’t used firebase, but seems like you might want to use
callbackFlow { }
builder instead of
flow { }
☝️ 6
o
g
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
Okay thanks