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

LaunchedEffect keyed on Unit

The parent changes userId from "a" to "b" while this Profile composable stays on screen. What happens?

@Composable
fun Profile(userId: String, vm: ProfileViewModel) {
  LaunchedEffect(Unit) {
    vm.load(userId)
  }
  // ... UI
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions