MCPcopy Index your code
hub / github.com/TanStack/query / add

Method add

packages/query-core/src/mutationCache.ts:123–135  ·  view source on GitHub ↗
(mutation: Mutation<any, any, any, any>)

Source from the content-addressed store, hash-verified

121 }
122
123 add(mutation: Mutation<any, any, any, any>): void {
124 this.#mutations.add(mutation)
125 const scope = scopeFor(mutation)
126 if (typeof scope === 'string') {
127 const scopedMutations = this.#scopes.get(scope)
128 if (scopedMutations) {
129 scopedMutations.push(mutation)
130 } else {
131 this.#scopes.set(scope, [mutation])
132 }
133 }
134 this.notify({ type: 'added', mutation })
135 }
136
137 remove(mutation: Mutation<any, any, any, any>): void {
138 if (this.#mutations.delete(mutation)) {

Callers 1

buildMethod · 0.95

Calls 3

notifyMethod · 0.95
scopeForFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected