MCPcopy
hub / github.com/TanStack/query / #notify

Method #notify

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

Source from the content-addressed store, hash-verified

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

Callers 1

updateResultMethod · 0.95

Calls 3

getQueryCacheMethod · 0.80
listenerFunction · 0.50
notifyMethod · 0.45

Tested by

no test coverage detected