I need to launch a coroutine in the `onDispose` of...
# compose
v
I need to launch a coroutine in the
onDispose
of the DisposableEffect but I'm getting a
JobCancellationException
. This is probably due to the coroutine scope that I'm using (its the one that
rememberCoroutineScope
returns) that's not available anymore when I'm executing the
onDispose
block. Wondering how I can solve this?
z
Why do you need to launch a coroutine?
v
Trying to emit an event to a StateFlow
z
That never actually blocks right? Just use runBlocking
Or better yet, tryEmit
v
Doesn't work unfortunately.
z
Can you elaborate?