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

Method getObserversCount

packages/query-core/src/query.ts:673–675  ·  view source on GitHub ↗

* Returns the number of observers currently subscribed to this query. * @returns The number of observers. * @example * ```ts * if (query.getObserversCount() === 0) { * // no component is currently watching this query * } * ```

()

Source from the content-addressed store, hash-verified

671 * ```
672 */
673 getObserversCount(): number {
674 return this.observers.length
675 }
676
677 /**
678 * Marks the query as invalidated, unless it is already invalidated. This

Callers 15

isDisabledMethod · 0.95
isStaticMethod · 0.95
isStaleMethod · 0.95
getQueryStateFunction · 0.80
setupDevtoolsFunction · 0.80
QueryRowFunction · 0.80
QueryDetailsFunction · 0.80
getQueryStatusLabelFunction · 0.80
getStatusRankFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected