MCPcopy Create free account
hub / github.com/TanStack/query / #notify

Method #notify

packages/query-core/src/queryObserver.ts:709–724  ·  view source on GitHub ↗
(notifyOptions: { listeners: boolean })

Source from the content-addressed store, hash-verified

707 }
708
709 #notify(notifyOptions: { listeners: boolean }): void {
710 notifyManager.batch(() => {
711 // First, trigger the listeners
712 if (notifyOptions.listeners) {
713 this.listeners.forEach((listener) => {
714 listener(this.#currentResult)
715 })
716 }
717
718 // Then the cache listeners
719 this.#client.getQueryCache().notify({
720 query: this.#currentQuery,
721 type: 'observerResultsUpdated',
722 })
723 })
724 }
725}
726
727function shouldLoadOnMount(

Callers 1

updateResultMethod · 0.95

Calls 3

getQueryCacheMethod · 0.80
listenerFunction · 0.50
notifyMethod · 0.45

Tested by

no test coverage detected