Skip to content

Instantly share code, notes, and snippets.

@saqib-github-commits
Last active May 17, 2023 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saqib-github-commits/68ed2737a1e3e9dd465a09b2518c6293 to your computer and use it in GitHub Desktop.
Save saqib-github-commits/68ed2737a1e3e9dd465a09b2518c6293 to your computer and use it in GitHub Desktop.
@Composable
fun DisposableEffectTestScreen(
viewModel: DisposableEffectTestViewModel
) {
val count = viewModel.count.collectAsState()
DisposableEffect(count.value) {
println("DisposableEffect block called for count = ${count.value}")
onDispose {
println("onDispose Called")
}
}
// compose content
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment