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

Function getStatusRank

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

Source from the content-addressed store, hash-verified

91type SortFn = (a: Query, b: Query) => number
92
93const getStatusRank = (q: Query) =>
94 q.state.fetchStatus !== 'idle'
95 ? 0
96 : !q.getObserversCount()
97 ? 3
98 : q.isStale()
99 ? 2
100 : 1
101
102const queryHashSort: SortFn = (a, b) => a.queryHash.localeCompare(b.queryHash)
103

Callers 1

statusAndDateSortFunction · 0.85

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…