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

Method #notify

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

Source from the content-addressed store, hash-verified

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

Callers 1

updateResultMethod · 0.95

Calls 3

getQueryCacheMethod · 0.80
listenerFunction · 0.50
notifyMethod · 0.45

Tested by

no test coverage detected