started to write my own paging lib, plz send help #AndroidDev
Paging by matt-ramotar · Pull Request #611 · MobileNativeFoundation/Store

Context: Closes #602 Addresses @yigit feedback #603 (comment) Addresses #608 Paging Technical Design Doc 1. Motivations Powerful and extensible solution for paging in KMP projects, under the Mobi...

GitHub
@friendlymike @pixellight @mattramotar oh my god this is addressing literally all the problems I am running into with AndroidX Paging right now. Will try to find some time over the next week to go through the code and see if I can help get this over the finish line.
@msfjarvis @pixellight @mattramotar honestly code reviewers would help a ton. I've been busy with family band Matt can't write and review his own code 😅
@friendlymike @msfjarvis @pixellight @mattramotar I've been passively writing my own paging library and it has been quite challenging so far. All the best to both of you!
@msfjarvis @friendlymike @pixellight @mattramotar what specific issues are you having with AndroidX Paging? I'd be curious to know if they're things already on our roadmap or something different.

@ianlake The broad problem I have is that there appears to be no way for me to perform a local-only update that doesn't require a full refresh from the the network.

The concrete example in my situation is this: I fetch a list of news items from a remote API and map it into a domain type with fields sourced from a local database. On a database change, I would like to be able to patch in that updated item into the state maintained by Paging.

@msfjarvis mmm, but Paging itself doesn't care if the PagingSource you write is backed by a database directly (e.g., what the room-paging integration requires) or an amalgamation of two sources (web loaded content that isn't in a database + database content)?

A PagingSource load() can similarly do whatever you want based on the freshness of cached web content (i.e., not reload web content that is already up to date while always loading the latest local data) to form the final data to present.

@ianlake @msfjarvis @friendlymike @pixellight hey all - we started exploring this after receiving a lot of requests for a paging solution that could delegate loading and caching to Store. Integrating with AndroidX Paging would be ideal, but I didn't see a clean solution with changes just on our side. Other limitations/feature requests we've gotten: (1) local mutations and streaming of child items within the list of paging items, and (2) custom middleware, reducers, and post-reducer effects
GitHub - matt-ramotar/Paging

Contribute to matt-ramotar/Paging development by creating an account on GitHub.

GitHub

@mattramotar @msfjarvis @friendlymike @pixellight Paging is very much based on having a source of truth, so mutations are indeed something that would need to be reflected in that source of truth to then feed up through the rest of the system, but I'm not sure what you mean by custom middleware, reducers, and post-reducer effects?

If there were changes you thought you needed on the Paging side for Store, did you have a chance to file issues for them? I'd be interested in looking them over.

@ianlake @msfjarvis @friendlymike @pixellight Those concepts were added after requests for control of paging state. The PR Mike linked has a design doc. High level: When a paging action is dispatched, it goes through middleware pipeline. Middleware can modify the action. Reducer updates state based on final action. Updated state emitted to UI. After reducer, we launch any effects associated with final action and state. Providing default impls for everything bc not all users will want this
@ianlake @msfjarvis @friendlymike @pixellight More than happy to file issues/start discussion, haven't yet