onCacheEntryAdded works only the first time? #3017
-
Hi am new to Streaming Updates, please help with this I have a query to get the user's info
then in a component, I am using it like
I only see the I am trying to fetch the data using socket every x second. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As the name suggests, it is executed when a cache entry is added. You might be looking for |
Beta Was this translation helpful? Give feedback.
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 calluseGetUserInfoQuery(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 foronCacheEntryAdded
.