Replies: 1 comment
-
we currently don’t track the type of a fetch so we can’t expose this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
Currently, TanStack Query provides isFetching, isRefetching, and isLoading states, but it doesn't explicitly return the type of query being performed (e.g., initial load, manual refetch, refetchInterval, window focus refetch, etc.). This makes it difficult to implement fine-grained UI controls, such as showing a loading spinner only for specific types of queries.
Proposed Solution:
Add a new property (e.g., queryType) to the useQuery return object that indicates the type of query being performed. For example:
initial: Initial data fetch.
manual: Manual refetch triggered by refetch().
interval: Refetch triggered by refetchInterval.
focus: Refetch triggered by window focus.
Beta Was this translation helpful? Give feedback.
All reactions