-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add refetchCachedPages option for infinite query #5016
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
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 81715b2:
|
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Any update on this PR? This behavior is super helpful-- I've been patching this onto my projects (and can continue to, but it's tedious to build a new patch for each rtk version update), and refreshing has been working great with it. |
|
I'll try to find some time to review it in the next few days. Good to know that A) it's useful, and B) the approach appears to be working - thanks for that feedback! |
896b35d to
8d46313
Compare
|
Out in https://github.com/reduxjs/redux-toolkit/releases/tag/v2.11.0 ! Thanks! |
This
refetchCachedPagesoption allows an infinite query to NOT refetch all pages in the cache when a refetch happens. By default it istrueand uses the existing behavior.This is based on what was mentioned in the discussion here - #5011. It's also based on this resolved issue here - #4920
We want the ability to opt out of this behavior at this level. We don't want to have to reset the
pages/pageParamsfor a query when args change or during a refetch.Here is an example of how it can be used: