-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: respect cancelRefetch flag for infinite queries (fetchNextPage, fetchPreviousPage) #2731
feat: respect cancelRefetch flag for infinite queries (fetchNextPage, fetchPreviousPage) #2731
Conversation
… fetchPreviousPage)
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tannerlinsley/react-query/6CW2HtrMoySqhpNm8ByJWWDMGSmQ |
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 4c1194d:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome. could you please
- update the api docs (https://react-query.tanstack.com/reference/useInfiniteQuery), as
options.pageParam
is also mentioned forfetchNextPage
/fetchPreviousPage
) - add a test for passing
cancelRefetch: false
@TkDodo I'm sorry, I feel a bit lost about the testing part. Could you please point me to an example where |
I would probably just test if |
…lag-for-fetchNextPage-and-fetchPreviousPage
…hNextPage and fetchPreviousPage
@TkDodo I addressed your points 😃
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Would you consider this a feature rather than a bugfix ? |
🎉 This PR is included in version 3.26.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@TkDodo I guess so. Mainly because we didn't agree that the previous behavior was a bug on the first place 🤷♀️ |
closes #2617
Changes
cancelRefetch
toFetchNextPageOptions
andFetchPreviousPageOptions
interfacescancelRefetch
flag down tothis.fetch
, defaulting it totrue
.idea
folder to.gitignore
(Webstorm project config folder)