Ink
03/22/2024, 10:46 AMvar option: Option by mutableStateOf(Option.Default)
fun optionsFlow(): Flow<Option> = snapshotFlow { option }
option = Option.Default
launch{
state.optionsFlow().collectLatest{
println(it)
}
}
CLOVIS
03/22/2024, 10:57 AMsnapshotFlow
doesn't emit when the same value is emitted multiple times: https://developer.android.com/jetpack/compose/side-effects#snapshotFlowInk
03/22/2024, 10:58 AMCLOVIS
03/22/2024, 10:58 AMZach Klippenstein (he/him) [MOD]
03/22/2024, 2:16 PMZach Klippenstein (he/him) [MOD]
03/22/2024, 2:17 PMZach Klippenstein (he/him) [MOD]
03/22/2024, 2:18 PM