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

Method #notify

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

Source from the content-addressed store, hash-verified

728 }
729
730 #notify(notifyOptions: { listeners: boolean }): void {
731 notifyManager.batch(() => {
732 // First, trigger the listeners
733 if (notifyOptions.listeners) {
734 this.listeners.forEach((listener) => {
735 listener(this.#currentResult)
736 })
737 }
738
739 // Then the cache listeners
740 this.#client.getQueryCache().notify({
741 query: this.#currentQuery,
742 type: 'observerResultsUpdated',
743 })
744 })
745 }
746}
747
748function shouldLoadOnMount(

Callers 1

updateResultMethod · 0.95

Calls 3

getQueryCacheMethod · 0.80
listenerFunction · 0.50
notifyMethod · 0.45

Tested by

no test coverage detected