Skip to content
RED SAGSkills
hard20 pts · first answer countsjetpack-composeside-effects

Stale callback in a long effect

One second after Splash appears, the parent passes a new onTimeout lambda. Which lambda is called after 3 seconds?

@Composable
fun Splash(onTimeout: () -> Unit) {
  LaunchedEffect(Unit) {
    delay(3000)
    onTimeout()
  }
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions