Skip to content
Discussion options

You must be logged in to vote

onSuccess will run one time for each useQuery instance (=observer), and for each one, it will get the observer specific data, which is the one it gets from select.

Now if you have two observers with different select outputs, I'm having a hard time coming up with a side-effect that should be run twice after a fetch, but with the same original / full data 🤔

If your intention is to only run the side-effect once per fetch, have a look at the global queryCache callbacks.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@cwhenderson20
Comment options

@TkDodo
Comment options

@cwhenderson20
Comment options

Answer selected by cwhenderson20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants