Skip to content

How are simultaneous calls to useQuery handled? #4543

Answered by phryneas
sbruinsje asked this question in Q&A
Discussion options

You must be logged in to vote

R will resolve cache entry for R
RT will resolve cache entry for RT
RTK will resolve cache entry for RTK

meanwhile
the hook looks at the cache entry for R
the hook looks at the cache entry for RT. If the hook already had data from before switching to RT, it will keep that until new data for RT arrived
the hook looks at the cache entry for RTK. If the hook already had data from before switching to RTK, it will keep that until new data for RTK arrived

There's no real "concurrency" going on. Three different requests for three different cache entries, and a hook that only looks at one of them at a time, but might keep old results around.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@sbruinsje
Comment options

@markerikson
Comment options

@phryneas
Comment options

Answer selected by sbruinsje
@sbruinsje
Comment options

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