-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RTK-Query: add ability to get access to latest batch info when using merge #2870
Comments
Additionally I've found potential issue.. when we have some accumulated data and then at some point |
Filed #2871 to cover the data aspect, since that's a completely separate issue. For this question, no, I don't think we would want to change Not sure what an actual API solution would look like, but as a workaround, you could use |
Yep.. it's achievable through Thanks for the idea! |
Hello, could you share your implementation, please 🙏 |
merge
prop introduced in v1.9.0 is super great and makes infinity scroll almost out-of-the-box experience!However
merge
just give ability to accumulate data, but in some cases we need a bit more - we need to know what's inside the latest batch in order to consider if we should keep loading or not.Use Case
Infinite loading over unknown amount of pages with non guaranteed items count per page. For example we would like to set
skip: true
for a query when we know that latest batch had exactly 0 items.Right now we can't achieve this as data in
data
¤tData
props is accumulated data.Proposal
The proposal is to repurpose
currentData
for this case not to contain accumulated data, but only state of latest/current batch.Or just introduce another prop which would hold this data (
latestData
/latestBatch
or whatever you consider reasonable).Example of what I would like to achieve:
Thank you!
The text was updated successfully, but these errors were encountered: