Tash

    Tash

    1 year ago
    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
    )
    Andrey Kulikov

    Andrey Kulikov

    1 year ago
    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
    Tash

    Tash

    1 year ago
    Gotcha, thanks! I like the idea of immutability, might end up going with
    mutableStateOf<List<Item>>()
    itself