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
V4: streamline cancel refetch #2937
Commits on Nov 13, 2021
-
feat: streamline cancelRefetch
the following functions now default to true for cancelRefetch: - refetchQueries (+invalidateQueries, + resetQueries) - query.refetch - fetchNextPage (unchanged) - fetchPreviousPage (unchanged)
Configuration menu - View commit details
-
Copy full SHA for d43557c - Browse repository at this point
Copy the full SHA d43557cView commit details -
feat: streamline cancelRefetch
make sure that refetchOnReconnect and refetchOnWindowFocus do not cancel already running requests
Configuration menu - View commit details
-
Copy full SHA for 41c9b36 - Browse repository at this point
Copy the full SHA 41c9b36View commit details -
feat: streamline cancelRefetch
update tests refetch and invalidate now both cancel previous queries, which is intended, so we get more calls to the queryFn in these cases
Configuration menu - View commit details
-
Copy full SHA for c19eb3f - Browse repository at this point
Copy the full SHA c19eb3fView commit details -
feat: streamline cancelRefetch
add more tests for cancelRefetch behavior
Configuration menu - View commit details
-
Copy full SHA for ce67c20 - Browse repository at this point
Copy the full SHA ce67c20View commit details -
Configuration menu - View commit details
-
Copy full SHA for c248e49 - Browse repository at this point
Copy the full SHA c248e49View commit details -
feat: streamline cancelRefetch
simplify conditions by moving the ?? true default down to fetch on observer level; all 3 callers (fetchNextPage, fetchPreviousPage and refetch) just pass their options down and adhere to this default; refetch also only has 3 callers: - refetch from useQuery, where we want the default - onOnline and onFocus, where we now explicitly pass false to keep the previous behavior and add more tests
Configuration menu - View commit details
-
Copy full SHA for 8ec3cc3 - Browse repository at this point
Copy the full SHA 8ec3cc3View commit details -
feat: streamline cancelRefetch
we always call this.fetch() with options, so we can just as well make the mandatory also, streamline signatures by destructing values that can't be forwarded (and use empty object as default value) in options and just spread the rest
Configuration menu - View commit details
-
Copy full SHA for e7013f3 - Browse repository at this point
Copy the full SHA e7013f3View commit details -
feat: streamline cancelRefetch
fix types for refetch it was accidentally made too wide and allowed all refetchFilters, like `predicate`; but with `refetch` on an obserserver, there is nothing to filter for, except the page, so that is what we need to accept via `RefetchPageFilters`
Configuration menu - View commit details
-
Copy full SHA for 8af0081 - Browse repository at this point
Copy the full SHA 8af0081View commit details -
feat: streamline cancelRefetch
refetch never took a queryKey as param - it is always bound to the observer
Configuration menu - View commit details
-
Copy full SHA for 9048c89 - Browse repository at this point
Copy the full SHA 9048c89View commit details