enighma
07/16/2020, 10:20 PMoctylFractal
07/16/2020, 10:20 PMsuspendCancellableCoroutine
will handle most of the work for youoctylFractal
07/16/2020, 10:22 PMsuspendCancellableCoroutine { cont ->
javaApi.withCallback { data, err ->
if (err != null) cont.resumeWithException(err)
else cont.resumeWith(data)
}
}
ephemient
07/16/2020, 10:22 PMcallbackFlow
if the callback can be invoked multiple timesoctylFractal
07/16/2020, 10:23 PMcont.invokeOnCancellation { unsusbcribe() }
enighma
07/16/2020, 10:24 PMenighma
01/27/2021, 3:06 AMAmbientIndication provides @Composable { MyIndication },
That way I can easily either have NoIndication or something else 🙂