You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we build our own coroutine scope to encapsulate all of the work required to render. When this scope ends, rendering ends and the program exits cleanly (modulo internal nonsense to make this work).
Ideally effects inside the composition are used to scope the composition instead. Compose internals currently prevent this, which is tracked as https://issuetracker.google.com/issues/169425431.
The text was updated successfully, but these errors were encountered:
funmain() = runMosaic {
val countValue = mutableStateOf(0)
setContent {
val count by remember { countValue }
Text("The count is: $count")
}
for (i in1..20) {
delay(250)
countValue.value = i
}
}
Tomorrow:
funmain() = runMosaic {
val count by remember { mutableStateOf(0) }
Text("The count is: $count")
LaunchedEffect(null) {
for (i in1..20) {
delay(250)
count++
}
}
}
Currently we build our own coroutine scope to encapsulate all of the work required to render. When this scope ends, rendering ends and the program exits cleanly (modulo internal nonsense to make this work).
Ideally effects inside the composition are used to scope the composition instead. Compose internals currently prevent this, which is tracked as https://issuetracker.google.com/issues/169425431.
The text was updated successfully, but these errors were encountered: