Colton Idle
06/18/2024, 12:21 AMmutableStateListOf<MyItem>
and I call
state.myList.add(thing)
state.myList.sortBy { it.name }
but the item seems added and then sorted (not a huge list either. like 10 things) so the UI looks kinda jumpy. anything I can do for that?eygraber
06/18/2024, 12:34 AMephemient
06/18/2024, 12:44 AMephemient
06/18/2024, 12:50 AMephemient
06/18/2024, 12:53 AMval myList = MutableStateFlow(listOf<MyItem>())
myList.update { (it + thing).sortedBy { it.name } }
and observing myList.collectAsState()
would be atomicephemient
06/18/2024, 12:53 AMeygraber
06/18/2024, 1:27 AMjw
06/18/2024, 1:31 AMephemient
06/18/2024, 1:31 AMSnapshot.withMutableSnapshot { }
could helpColton Idle
06/18/2024, 4:35 AM