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(QueryObserver): track queries as default #2987
Merged
TkDodo
merged 13 commits into
TanStack:v4
from
babycourageous:feature/queries-default-tracked
Nov 20, 2021
Merged
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
66bf3ec
feat(Query Options): remove notifyOnChangePropsExclusion
babycourageous 3b2af74
docs(Query Options): update notifyOnChangePropsExclusion sections
babycourageous 49069f7
feat(QueryObserver): "tracked" as default behavior
babycourageous 5634c80
Merge branch 'v4' of github.com:tannerlinsley/react-query into featur…
babycourageous 74d72ed
test(useQuery): adjust tests to pass for notifyOnChangeProps udpate
babycourageous 497d4ac
test(useInfiniteQuery): adjust tests to pass for notifyOnChangeProps …
babycourageous a34b472
test(QueryResetErrorBoundary): adjust tests to pass for notifyOnChang…
babycourageous 17b2197
refactor(QueryObserver): use nullish coalescing operator
babycourageous c5eb322
Merge branch 'v4' into feature/queries-default-tracked
babycourageous c57e400
test(QueryResetErrorBoundary): remove "tracked" from test
babycourageous fcd615c
revert: test(QueryResetErrorBoundary): adjust tests to pass for notif…
babycourageous 0f4bf90
refactor(QueryObserver): combine prop checks
babycourageous 10215b0
docs(notifyOnChangeProps): update docs to reflect new api
babycourageous File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,11 +160,7 @@ export interface QueryObserverOptions< | |
* When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change. | ||
* When set to `tracked`, access to properties will be tracked, and the component will only re-render when one of the tracked properties change. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the comment is no longer accurate here :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yah - this is for sure part of the docs i need to update |
||
*/ | ||
notifyOnChangeProps?: Array<keyof InfiniteQueryObserverResult> | 'tracked' | ||
/** | ||
* If set, the component will not re-render if any of the listed properties change. | ||
*/ | ||
notifyOnChangePropsExclusions?: Array<keyof InfiniteQueryObserverResult> | ||
notifyOnChangeProps?: Array<keyof InfiniteQueryObserverResult> | 'all' | ||
/** | ||
* This callback will fire any time the query successfully fetches new data or the cache is updated via `setQueryData`. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
let’s combine these two if statements that return true with an ||