-
Calling I propose we create a new For completeness, the same |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I agree with this - let’s include that in the v4 plan. Follow up question: since this is a callback on observer level, would this callback also be called when data changes for the observer because it was read from the cache? |
Beta Was this translation helpful? Give feedback.
I agree with this - let’s include that in the v4 plan.
Follow up question: since this is a callback on observer level, would this callback also be called when data changes for the observer because it was read from the cache?
For example, many people use onSuccess to put the data into local state or react context. While this is not really necessary, you can still do it. However, if you combine this approach with a high staleTime, if the query key changes, you’ll get no background refetch - just the data from the cache. So onSuccess is also not called, which puts you out of sync.
An onDataChanged callback could solve that, conceptually becoming an effect with
data
as dependency. What do you…