Lifecycle
Inside a Screen, you can call LifecycleEffect to listen for some events:
  • onStarted: called when the screen enters the composition
  • onDisposed: called when the screen is disposed
1
class PostListScreen : Screen {
2
3
@Composable
4
override fun Content() {
5
LifecycleEffect(
6
onStarted = { /*...*/ },
7
onDisposed = { /*...*/ }
8
)
9
10
// ...
11
}
12
}
Copied!
Last modified 3mo ago
Copy link