Hi, using Compose and Paging, is there a way to mutate the items? A normal use case is to have a list of items (paginated) where you can toggle a button on each item. E.g. follow/unfollow. In a non-compose setting I'd just update the reactive stream and react accordingly, but since Paging is wrapping the source, I'm unable to mutate. Is there another approach for this, or does the paging library simply only work with immutable data?
c
Csaba Kozák
10/19/2021, 7:44 AM
Can you share some code? You can update the data in VM, which will emit, and it will cause a recomposition to show new data.
f
Fredrik Larsen
10/19/2021, 7:53 AM
Hi, Csaba. Thanks for helping. I somehow missed the map operator for PagingData. I’m looking into it now. I’ll see if I can make a contrived example a bit later. The problem with invalidating the whole Pager is that everything invalidates. Not just the single item.
c
Csaba Kozák
10/19/2021, 7:55 AM
Ah, yes. We had this problem with Paging in non-Compose world as well. I do not think there is another way if you want to use the Paging library.
f
Fredrik Larsen
10/19/2021, 7:56 AM
I see. If that is the case it’s pretty useless for many/most use cases. I’ll let you know if I manage to get around this.
d
dewildte
10/19/2021, 2:40 PM
Can you have your data funnel from Paging into a proxy channel that you can control?
m
maxgdn
10/25/2021, 4:02 PM
Hi all. Was there any resolution or alternatives? Facing similar difficulties.