- Vue Reference
- Functions / defaultShouldDehydrateMutation
- Functions / defaultShouldDehydrateQuery
- Functions / dehydrate
- Functions / dehydrateQuery
- Functions / experimental_streamedQuery
- Functions / hashKey
- Functions / hydrate
- Functions / infiniteQueryOptions
- Functions / isCancelledError
- Functions / keepPreviousData
- Functions / matchMutation
- Functions / matchQuery
- Functions / mutationOptions
- Functions / noop
- Functions / partialMatchKey
- Functions / queryOptions
- Functions / replaceEqualDeep
- Functions / shouldThrowError
- Functions / useInfiniteQuery
- Functions / useIsFetching
- Functions / useIsMutating
- Functions / useMutation
- Functions / useMutationState
- Functions / usePrefetchInfiniteQuery
- Functions / usePrefetchQuery
- Functions / useQueries
- Functions / useQuery
- Functions / useQueryClient
- Classes / CancelledError
- Classes / InfiniteQueryObserver
- Classes / Mutation
- Classes / MutationCache
- Classes / MutationObserver
- Classes / QueriesObserver
- Classes / Query
- Classes / QueryCache
- Classes / QueryClient
- Classes / QueryObserver
- Interfaces / CancelOptions
- Interfaces / DefaultOptions
- Interfaces / DehydrateOptions
- Interfaces / DehydratedState
- Interfaces / EnsureQueryDataOptions
- Interfaces / FetchNextPageOptions
- Interfaces / FetchPreviousPageOptions
- Interfaces / FetchQueryOptions
- Interfaces / FocusManager
- Interfaces / HydrateOptions
- Interfaces / InfiniteData
- Interfaces / InfiniteQueryObserverBaseResult
- Interfaces / InfiniteQueryObserverLoadingErrorResult
- Interfaces / InfiniteQueryObserverLoadingResult
- Interfaces / InfiniteQueryObserverOptions
- Interfaces / InfiniteQueryObserverPendingResult
- Interfaces / InfiniteQueryObserverPlaceholderResult
- Interfaces / InfiniteQueryObserverRefetchErrorResult
- Interfaces / InfiniteQueryObserverSuccessResult
- Interfaces / InfiniteQueryPageParamsOptions
- Interfaces / InitialPageParam
- Interfaces / InvalidateOptions
- Interfaces / InvalidateQueryFilters
- Interfaces / MutateOptions
- Interfaces / MutationCacheConfig
- Interfaces / MutationObserverBaseResult
- Interfaces / MutationObserverErrorResult
- Interfaces / MutationObserverIdleResult
- Interfaces / MutationObserverLoadingResult
- Interfaces / MutationObserverOptions
- Interfaces / MutationObserverSuccessResult
- Interfaces / MutationState
- Interfaces / NotifyEvent
- Interfaces / OnlineManager
- Interfaces / QueriesObserverOptions
- Interfaces / QueryCacheConfig
- Interfaces / QueryClientConfig
- Interfaces / QueryExecuteOptions
- Interfaces / QueryObserverBaseResult
- Interfaces / QueryObserverLoadingErrorResult
- Interfaces / QueryObserverLoadingResult
- Interfaces / QueryObserverOptions
- Interfaces / QueryObserverPendingResult
- Interfaces / QueryObserverPlaceholderResult
- Interfaces / QueryObserverRefetchErrorResult
- Interfaces / QueryObserverSuccessResult
- Interfaces / QueryState
- Interfaces / RefetchOptions
- Interfaces / RefetchQueryFilters
- Interfaces / Register
- Interfaces / ResetOptions
- Interfaces / ResultOptions
- Interfaces / SetDataOptions
- Interfaces / TimeoutManager
- Types / AnyDataTag
- Types / DataTag
- Types / DefaultError
- Types / DefaultedInfiniteQueryObserverOptions
- Types / DefaultedQueryObserverOptions
- Types / DefinedInfiniteQueryObserverResult
- Types / DefinedInitialDataInfiniteOptions
- Types / DefinedInitialQueryOptions
- Types / DefinedInitialQueryOptionsWithDataTag
- Types / DefinedQueryObserverResult
- Types / DistributiveOmit
- Types / EnsureInfiniteQueryDataOptions
- Types / FetchInfiniteQueryOptions
- Types / FetchStatus
- Types / GetNextPageParamFunction
- Types / GetPreviousPageParamFunction
- Types / InferDataFromTag
- Types / InferErrorFromTag
- Types / InfiniteQueryExecuteOptions
- Types / InfiniteQueryObserverResult
- Types / InitialDataFunction
- Types / ManagedTimerId
- Types / MutateFunction
- Types / MutateFunctionRest
- Types / MutationCacheNotifyEvent
- Types / MutationFilters
- Types / MutationFunction
- Types / MutationFunctionContext
- Types / MutationKey
- Types / MutationMeta
- Types / MutationObserverResult
- Types / MutationOptions
- Types / MutationScope
- Types / MutationStateOptions
- Types / MutationStatus
- Types / NetworkMode
- Types / NonUndefinedGuard
- Types / NotifyEventType
- Types / NotifyOnChangeProps
- Types / OmitKeyof
- Types / Override
- Types / PlaceholderDataFunction
- Types / QueriesPlaceholderDataFunction
- Types / QueryBooleanOption
- Types / QueryCacheNotifyEvent
- Types / QueryFilters
- Types / QueryFunction
- Types / QueryFunctionContext
- Types / QueryKey
- Types / QueryKeyHashFunction
- Types / QueryKeyWithDataTag
- Types / QueryMeta
- Types / QueryObserverResult
- Types / QueryOptions
- Types / QueryPersister
- Types / QueryStatus
- Types / SkipToken
- Types / StaleTime
- Types / StaleTimeFunction
- Types / ThrowOnError
- Types / TimeoutCallback
- Types / TimeoutProvider
- Types / UndefinedInitialDataInfiniteOptions
- Types / UndefinedInitialQueryOptions
- Types / UndefinedInitialQueryOptionsWithDataTag
- Types / UnsetMarker
- Types / Updater
- Types / UseInfiniteQueryOptions
- Types / UseInfiniteQueryReturnType
- Types / UseMutationOptions
- Types / UseMutationReturnType
- Types / UsePrefetchInfiniteQueryOptions
- Types / UsePrefetchQueryOptions
- Types / UseQueriesOptions
- Types / UseQueriesResults
- Types / UseQueryDefinedReturnType
- Types / UseQueryOptions
- Types / UseQueryReturnType
- Types / VueQueryPluginOptions
- Types / WithRequired
- Types / dataTagErrorSymbol
- Types / dataTagSymbol
- Variables / VueQueryPlugin
- Variables / dataTagErrorSymbol
- Variables / dataTagSymbol
- Variables / defaultScheduler
- Variables / environmentManager
- Variables / focusManager
- Variables / isServer
- Variables / notifyManager
- Variables / onlineManager
- Variables / skipToken
- Variables / timeoutManager
- Variables / unsetMarker
useIsFetching
function useIsFetching(fetchingFilters?: UseIsFetchingFilters, queryClient?: QueryClient): Ref<number>;Defined in: packages/vue-query/src/useIsFetching.ts:55
The useIsFetching composable returns a ref to the number of the queries that your application is loading or fetching in the background (useful for app-wide loading indicators).
fetchingFilters may be a plain object, MaybeRefDeep, or a reactive getter (() => ({ ... })) — pass a getter if the filters themselves depend on other reactive state.
Parameters#
fetchingFilters?#
UseIsFetchingFilters = {}
The QueryFilters to narrow down the matched queries.
queryClient?#
Use this to use a custom QueryClient. Otherwise, the one provided by VueQueryPlugin will be used.
Returns#
Ref<number>
A ref to the number of the queries that your application is currently loading or fetching in the background.
Examples#
<script setup lang="ts">
import { useIsFetching } from '@tanstack/vue-query'
// How many queries matching the posts prefix are fetching?
const isFetchingPosts = useIsFetching({ queryKey: ['posts'] })
</script>
<template>
<span v-if="isFetchingPosts">Refreshing posts...</span>
</template>A global loading indicator for any query fetching in the background, not just the ones on screen:
<script setup lang="ts">
import { useIsFetching } from '@tanstack/vue-query'
const isFetching = useIsFetching()
</script>
<template>
<div v-if="isFetching">Queries are fetching in the background...</div>
</template>