Hi, using Compose and Paging, is there a way to mu...
# compose
f
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
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
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
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
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
Can you have your data funnel from Paging into a proxy channel that you can control?
m
Hi all. Was there any resolution or alternatives? Facing similar difficulties.