MCPcopy Create free account
hub / github.com/TanStack/query / useIsFetching

Function useIsFetching

packages/react-query/src/useIsFetching.ts:44–60  ·  view source on GitHub ↗
(
  filters?: QueryFilters,
  queryClient?: QueryClient,
)

Source from the content-addressed store, hash-verified

42 * ```
43 */
44export function useIsFetching(
45 filters?: QueryFilters,
46 queryClient?: QueryClient,
47): number {
48 const client = useQueryClient(queryClient)
49 const queryCache = client.getQueryCache()
50
51 return React.useSyncExternalStore(
52 React.useCallback(
53 (onStoreChange) =>
54 queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),
55 [queryCache],
56 ),
57 () => client.isFetching(filters),
58 () => client.isFetching(filters),
59 )
60}

Callers 10

WithKnownParametersFunction · 0.90
WithIdentifiersFunction · 0.90
WithKnownParametersFunction · 0.90
WithIdentifiersFunction · 0.90
ExamplesFunction · 0.90
ExamplesFunction · 0.90
RootFunction · 0.90
PageFunction · 0.50
IsFetchingFunction · 0.50
PageFunction · 0.50

Calls 4

useQueryClientFunction · 0.90
getQueryCacheMethod · 0.80
subscribeMethod · 0.45
isFetchingMethod · 0.45

Tested by 3

PageFunction · 0.40
IsFetchingFunction · 0.40
PageFunction · 0.40