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

Function isStale

packages/query-core/src/queryObserver.ts:805–813  ·  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

803}
804
805function isStale(
806 query: Query<any, any, any, any>,
807 options: QueryObserverOptions<any, any, any, any, any>,
808): boolean {
809 return (
810 resolveQueryBoolean(options.enabled, query) !== false &&
811 query.isStaleByTime(resolveStaleTime(options.staleTime, query))
812 )
813}
814
815// this function would decide if we will update the observer's 'current'
816// 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