Skip to content

onCacheEntryAdded works only the first time? #3017

Answered by phryneas
mad-coder-365 asked this question in Q&A
Discussion options

You must be logged in to vote

As the name suggests, it is executed when a cache entry is added. useGetUserInfoQuery(null) will always share the same cache entry with every other place where you call useGetUserInfoQuery(null) (as both the endpoint and the argument are the same), so the cache entry is just used.
Updating an endpoint does not mean creating a new one - hence this only executes once.

You might be looking for onQueryStarted, not for onCacheEntryAdded.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mad-coder-365
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