Is there a way to execute only one onSuccess callback after the network request, no matter how many instances of a certain query there are on a page? #4859
Answered
by
TkDodo
smashercosmo
asked this question in
Q&A
-
According to this twitter discussion https://twitter.com/shcoding/status/1617206486660161537 when there are multiple instances of a certain query on a page all their onSuccess callbacks will be executed after the network request. Sometimes it can be wasteful. Is there a way to avoid that? |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Jan 23, 2023
Replies: 1 comment 1 reply
-
https://tanstack.com/query/v4/docs/react/reference/QueryCache#global-callbacks |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
smashercosmo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://tanstack.com/query/v4/docs/react/reference/QueryCache#global-callbacks