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

Function isStale

packages/query-core/src/queryObserver.ts:782–790  ·  view source on GitHub ↗
(
  query: Query<any, any, any, any>,
  options: QueryObserverOptions<any, any, any, any, any>,
)

Source from the content-addressed store, hash-verified

780}
781
782function isStale(
783 query: Query<any, any, any, any>,
784 options: QueryObserverOptions<any, any, any, any, any>,
785): boolean {
786 return (
787 resolveQueryBoolean(options.enabled, query) !== false &&
788 query.isStaleByTime(resolveStaleTime(options.staleTime, query))
789 )
790}
791
792// this function would decide if we will update the observer's 'current'
793// properties after an optimistic reading via getOptimisticResult

Callers 4

QueryRowFunction · 0.85
createResultMethod · 0.85
shouldFetchOnFunction · 0.85
shouldFetchOptionallyFunction · 0.85

Calls 3

resolveQueryBooleanFunction · 0.90
resolveStaleTimeFunction · 0.90
isStaleByTimeMethod · 0.80

Tested by

no test coverage detected