What is the proper way make a call back that is ca...
# coroutines
l
What is the proper way make a call back that is called multiple times into a flow? similar to this but that gets called ony once: https://stackoverflow.com/questions/48552925/existing-3-function-callback-to-kotlin-coroutines/48562175#48562175
obviously what I wrote wont' work, it gives handle is not suspend function error
s
Use
callbackFlow
instead of
flow
and at the end of the lambda you provide, call
awaitClose { … }
👍 1