Dose anyone know that when the `onForgotten` of `L...
# compose
h
Dose anyone know that when the
onForgotten
of
LaunchedEffect
would be executed? I faced a problem that my job inside
LaunchedEffect
is canceled and I don’t know the reason.
s
That job will be cancelled when either 1. One of the keys changes, therefore the old job is cancelled and a new one starts. 2. The composable exits composition entirely, cancelling the job and not starting a new one after that
h
Thanks for replying. for 2 : Is it just like
onDispose
for this composable?
s
I am not sure what you are referring to when you say
onDispose
. For
LaunchedEffect
there’s not such function, for
DisposableEffect
yes,
onDispose
would be called in this case when the composable exits composition if that’s what you are asking.