Colton Idle
06/11/2022, 12:31 AMmutableStateListOf<Item>
and then just list.clear()
and list.addAll()
when I get a new list that's mostly the same?
My use case:
I am using Firestore where you can listen to a query via a Flow. So if I listen to a query of top20Books(), and I show that in my list, but one of the ratings on the books changes, my listener will get invoked again, which will cause me to throw away the old list and add the new list. But the only item that change was the top item, where the rating changed from a 4.82 to a 4.83.
Or should I take a different route on this. Like should I try to do the diffing myself?Stylianos Gakis
06/11/2022, 7:57 AMFunkyMuse
06/11/2022, 11:08 AMshikasd
06/11/2022, 1:47 PMaddAll
and clear
right next to each other, it should trigger observers only onceStylianos Gakis
06/11/2022, 1:51 PMJoseph Hawkes-Cates
06/11/2022, 5:06 PMJoseph Hawkes-Cates
06/11/2022, 5:07 PMJoseph Hawkes-Cates
06/11/2022, 5:09 PMColton Idle
06/12/2022, 3:55 PM