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

Function scopeFor

packages/query-core/src/mutationCache.ts:375–377  ·  view source on GitHub ↗

* Returns the scope id of a mutation, used to run mutations with the same scope one after another. * @param mutation - The mutation to read the scope of. * @returns The mutation's `scope.id`, or `undefined` if it has no scope.

(mutation: Mutation<any, any, any, any>)

Source from the content-addressed store, hash-verified

373 * @returns The mutation's `scope.id`, or `undefined` if it has no scope.
374 */
375function scopeFor(mutation: Mutation<any, any, any, any>) {
376 return mutation.options.scope?.id
377}

Callers 4

addMethod · 0.85
removeMethod · 0.85
canRunMethod · 0.85
runNextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected