the great warrior
11/12/2022, 8:34 AMval descriptionListState = remember{ mutableStateListOf("") }
LaunchedEffect(descriptionListState.toList()) {
alarmViewModel.changeCreateAlarmState(
createAlarmState.copy(description = descriptionListState.joinToString(" "))
)
}
robercoding
11/12/2022, 9:20 AMval descriptionListState = remember{ mutableStateListOf("") }
LaunchedEffect(Unit) {
snapshotFlow {
descriptionListState
}.collect {
alarmViewModel.changeCreateAlarmState(
createAlarmState.copy(description = it.toList().joinToString(" "))
)
}
}
robercoding
11/12/2022, 9:23 AMcollect
you take the most recent value and convert it to a listZun
11/12/2022, 9:25 AMrobercoding
11/12/2022, 9:26 AMthe great warrior
11/12/2022, 9:29 AMMichael Paus
11/12/2022, 12:56 PM