How do I wrap some callback inside an async or sus...
# coroutines
l
How do I wrap some callback inside an async or suspend function so I can return my own value. This is what I'm trying ....
s
Take a look at (Google) calling
suspendCancellableCoroutine { continuation -> ... }
. This call will suspend and the lambda with the
continuation
. You can use this continuation in your callbacks.
l
thanks
d
You can also use
callbackFlow { }
for this purpose.