-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to use paged content with Store? #63
Comments
It's hard. I've implemented this in the past without Store by implementing the fetcher and a separate query API:
Not sure if it's possible to integrate Store 4 with the upcoming Paging 3 to make this easier (being able to work with |
You can also subclass PositionalDataSource and override loadRange and loadInitial and provide a factory to be passed to LivePagedListBuilder. In loadInitial / loadRange (which load multiples, based on specified paging config), you then get data from your store. You gets some flowables back and then have to notify the provided callbacks. This would probably work with the other implementations of DataSource<K,V> provided by the Paging library. |
FYI i'm looking into this as part of Paging3 but there does not seem to be much benefit in putting store in front with the exception that it might help you cache paging across screens etc, if there is a case like it. |
@yigit at the very least is there currently a way to 'append' data to the stream returned from an existing Key? This would allow for the 'Load More' use case. |
Answering my own question it seems the current answer would be using a persister that returns a flow so that we can have it be the source of truth and append externally to the Store APIs. |
Closing, please use Paging3 on its own. Paging 3 has a multicaster built in and should serve use cases without needing store |
If Store is going to be Multiplatform and Paging 3 is not covering that, can be this implemented in Store? |
So Paging3 has the same caching features Store has, plus paging capabilities? Meaning that Paging3 is superior than Store, feature wise? |
* rename package from nytimes to dropbox * Update build.gradle Co-Authored-By: David Chang <changd@gmail.com>
Hi, I'm thinking if it is somehow possible to use paged content with the Store. I want to load feed with the newest data and when the user reaches the end of the feed then I want to load older data and so on.
I know that caching of such results can be hard since items can added, or removed, or moved. So I don't know if it is possible. One solution that I figured out would be to cache only the first page and then load others but I don't know how to implement this with the Store.
Can you help me with that?
Thank you for your response
The text was updated successfully, but these errors were encountered: