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

Method add

packages/query-core/src/queryCache.ts:181–190  ·  view source on GitHub ↗

@internal

(query: Query<any, any, any, any>)

Source from the content-addressed store, hash-verified

179
180 /** @internal */
181 add(query: Query<any, any, any, any>): void {
182 if (!this.#queries.has(query.queryHash)) {
183 this.#queries.set(query.queryHash, query)
184
185 this.notify({
186 type: 'added',
187 query,
188 })
189 }
190 }
191
192 /**
193 * Destroys the given `Query` and removes it from the cache, notifying subscribers with a

Callers 15

buildMethod · 0.95
resolveQueryClientSourceFunction · 0.45
addRootFunction · 0.45
addFullFunction · 0.45
collectTypeIdentifiersFunction · 0.45
addControllerMethod · 0.45
addControllerMethod · 0.45
addControllerMethod · 0.45
addControllerMethod · 0.45

Calls 1

notifyMethod · 0.95

Tested by 15

addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36
addControllerMethod · 0.36