If you have two useQuery with different staleTime, would you expect isStale returned from that useQuery to:
* Change individually as each staleTime passes?
* Change together when shortest staleTime has passed?
* Have access to both of the above as separate isGloballyStale/isLocallyStale?
I would expect it to follow each useQuery instance, same as refetchInterval etc.
But Im unsure what to expect if you tried using the global queryClient to check whether or not the data is stale…
I think this is correct. I think there are two types of staleness, global and local.
Local: Is it stale in this context?
Global: Is it stale in any context?
An interesting quirk of this is that global staleness can go true->false without a refetch if the observer with the lowest staleTime unmounts, but I think this makes sense, no longer any need to revalidate on window focus for example.
Local staleness should never go true->false without a refetch (unless you explicitly change the local staleTime I guess?), as this could mean hiding that manual refresh-button you were showing based on isStale.