I have MyScreen Composable function. I want to load some data from server when this screen appears. In usual android I would use
onResume()
and what I supposed to do now.
z
Zach Klippenstein (he/him) [MOD]
10/22/2020, 3:05 PM
Probably
LaunchedTask
would be best, since it launches a coroutine that will automatically get cancelled when the function leaves the composition.
If your API is callback based, you could also use
onActive
or
onCommit
with
onDispose
(soon to be renamed to
DisposableEffect
).
☝🏼 1
👍 1
a
alorma
10/26/2020, 7:01 PM
Hey.
But, i cannot use composable functions inside it, isn't?