Kyant
01/25/2023, 2:27 AMLaunchedEffect
running for the first time properly? The current solution is to add a "lock", but it is boilerplate.jw
01/25/2023, 2:40 AMKyant
01/25/2023, 2:43 AMkeys
to ()->Any
Stylianos Gakis
01/25/2023, 1:08 PMvar myState by remember { mutableStateOf(1) }
LaunchedEffect(Unit) {
snapshotFlow { myState }
.drop(1)
.collect { state ->
//do something on each state change
}
}
This should just drop the first state and run anything inside collect
on every other change. Could it be something you can use?Kyant
01/25/2023, 1:13 PM