-
Notifications
You must be signed in to change notification settings - Fork 197
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: centralize react-query queries #6049
Merged
Merged
Conversation
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 was referenced Jan 19, 2024
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
3 tasks
kaladinlight
approved these changes
Jan 19, 2024
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.
beautiful! and here I was going to comment on feat_blazingly_fast_lp
that we should look at drying up all of those useQuery
functions 😂
89f4b25
to
1486cb4
Compare
1486cb4
to
2a7b7ac
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
pools
(plural) and could cause bugs if we were to do anothermidgardPoolData
call somewhere else when expecting a single pool as a response:web/src/pages/ThorChainLP/hooks/usePools.ts
Lines 76 to 83 in deffcae
queryClient.fetchQuery
, sincequeryClient.fetchQuery()
calls can now be done in one line 🎉staleTime
defaults to queries -Infinity
for most, but sometimes a different one when applicable (keeping the same ones as currently), so we don't end up in cases where we void thestaleTime
guarantees by having different consumers use differentstaleTime
sPull Request Type
Issue (if applicable)
N/A
Risk
Theoretically low to none, effectively medium given the domain diffed. Common THORChain (THORNode/Midgard) fetching queries and THORChain LP queries have been moved to the new source-of-truth. The same queries configuration has been kept so this is most likely very low risk, however, the default
refetchOnMount
setting ofreact-query
has been switched tofalse
for performance reason, which may produce regressions in lending.Testing
Engineering
Operations
Screenshots (if applicable)
Lending paranoia test of status detection
lending.status.detection.mov
Re-mounted subscribers don't refetch anymore
(this diff DevTools on top, develop on the bottom)
perf.mov