Lifecycle
Inside a
Screen
, you can call LifecycleEffect
to listen for some events:onStarted
: called when the screen enters the compositiononDisposed
: called when the screen is disposed
class PostListScreen : Screen {
@Composable
override fun Content() {
LifecycleEffect(
onStarted = { /*...*/ },
onDisposed = { /*...*/ }
)
// ...
}
}
Last modified 2yr ago