In compose, how can we update single item in pagin...
# compose
r
In compose, how can we update single item in paging list (paging 3 library)? I wants to update paging list (
like
property of an object) when user click on like button.
s
paging source will emit a change if it detects that data changed
do you use paging with room? if so, you can just modify your item in database and paging will pick it up
r
I'm not using room, just using data from network. That's why I can't determine how to modify paging data
a
You will have to use room database with a remote mediator... Without which you cannot show changes in the ui
r
What if I don't want to use database (as it take time for data insertion)? I am searching for solution to directly modify paging data
I guess you could try to keep a list of items with changed like status, pagingFlow.map { /* modify based on list */ } and call invalidate when something changes
ultimately I decided to use room and fallback to destructive migration
711 Views