MCPcopy
hub / github.com/TanStack/query / getQueryStatusLabel

Function getQueryStatusLabel

packages/query-devtools/src/utils.tsx:6–16  ·  view source on GitHub ↗
(query: Query)

Source from the content-addressed store, hash-verified

4import type { DevtoolsPosition } from './contexts'
5
6export function getQueryStatusLabel(query: Query) {
7 return query.state.fetchStatus === 'fetching'
8 ? 'fetching'
9 : !query.getObserversCount()
10 ? 'inactive'
11 : query.state.fetchStatus === 'paused'
12 ? 'paused'
13 : query.isStale()
14 ? 'stale'
15 : 'fresh'
16}
17
18type QueryStatusLabel = 'fresh' | 'stale' | 'paused' | 'inactive' | 'fetching'
19

Callers 2

QueryStatusCountFunction · 0.90
QueryDetailsFunction · 0.90

Calls 2

getObserversCountMethod · 0.80
isStaleMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…