Update PagingSource data with new one (but keep previous data)

Viewed 122

I am using PagingSource to get paginated data from a remote service. It works well when scrolling down to get the available data but I need to be able to scroll up (when in position 0) to load old data. I managed this by intercepting the scroll up in that position and firing a new call to get the old data and this does work but the previous data disappears since it gets refreshed. That's why I need to keep the previous data after making the new request to get the old data and that's where it gets tricky since the paging data doesn't seem to support this without some sort of Room implementation due to the invalidate() method it triggers upon calling new data...

Is there any way to manage to keep old data while fetching new without implementing Room?

0 Answers
Related