Jonathan
11/17/2023, 10:47 PMval pickerState = rememberPickerState(initialNumberOfOptions = 10)
LaunchedEffect(key1 = pickerState.selectedOption) {
viewModel.onItemSelected(pickerState.selectedOption)
}
If not, what is the recommended pattern? I would like to update my viewModel with the current UI state.Chrimaeon
11/18/2023, 7:34 AMsnapshotFlow
inside the LaunchedEffect
https://developer.android.com/jetpack/compose/side-effectsJonathan
11/18/2023, 4:40 PMChrimaeon
11/18/2023, 4:47 PMJonathan
11/18/2023, 4:49 PMChrimaeon
11/18/2023, 4:51 PMJonathan
11/18/2023, 4:52 PMChrimaeon
11/18/2023, 4:52 PMJonathan
11/18/2023, 4:53 PMChrimaeon
11/18/2023, 4:53 PMJonathan
11/18/2023, 4:55 PMChrimaeon
11/18/2023, 4:57 PMJonathan
11/18/2023, 5:04 PMscrollToOption(…)
?