Hi y'all. What's the guidance for picking `mutable...
# compose
t
Hi y'all. What's the guidance for picking
mutableStateListOf<Item>()
vs
mutableStateOf<List<Item>>()
? Trying to assess stability/performance in the case of a
List
(size ~200) that will undergo random removals/insertions (that will be either displayed in a
LazyColumn
or
LazyGrid
)
a
I would say the performance is comparable in these cases. use the one which works better for your case. with mutableStateOf with immutable lists, which is requiring list allocation on every change, but the immutability often allows cleaner responsibility separation
t
Gotcha, thanks! I like the idea of immutability, might end up going with
mutableStateOf<List<Item>>()
itself