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

Method getObserversCount

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

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

()

Source from the content-addressed store, hash-verified

558 * ```
559 */
560 getObserversCount(): number {
561 return this.observers.length
562 }
563
564 /**
565 * Marks the query as invalidated, unless it is already invalidated. This

Callers 15

isDisabledMethod · 0.95
isStaticMethod · 0.95
isStaleMethod · 0.95
runFunction · 0.80
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