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

Method constructor

packages/query-core/src/mutationObserver.ts:57–72  ·  view source on GitHub ↗
(
    client: QueryClient,
    options: MutationObserverOptions<
      TData,
      TError,
      TVariables,
      TOnMutateResult
    >,
  )

Source from the content-addressed store, hash-verified

55 #mutateOptions?: MutateOptions<TData, TError, TVariables, TOnMutateResult>
56
57 constructor(
58 client: QueryClient,
59 options: MutationObserverOptions<
60 TData,
61 TError,
62 TVariables,
63 TOnMutateResult
64 >,
65 ) {
66 super()
67
68 this.#client = client
69 this.setOptions(options)
70 this.bindMethods()
71 this.#updateResult()
72 }
73
74 /**
75 * Binds the methods of the result (`mutate` and `reset`) to the observer, so they keep working when

Callers

nothing calls this directly

Calls 3

setOptionsMethod · 0.95
bindMethodsMethod · 0.95
#updateResultMethod · 0.95

Tested by

no test coverage detected