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

Method constructor

packages/query-core/src/mutation.ts:155–168  ·  view source on GitHub ↗
(
    config: MutationConfig<TData, TError, TVariables, TOnMutateResult>,
  )

Source from the content-addressed store, hash-verified

153 #retryer?: Retryer<TData>
154
155 constructor(
156 config: MutationConfig<TData, TError, TVariables, TOnMutateResult>,
157 ) {
158 super()
159
160 this.#client = config.client
161 this.mutationId = config.mutationId
162 this.#mutationCache = config.mutationCache
163 this.#observers = []
164 this.state = config.state || getDefaultState()
165
166 this.setOptions(config.options)
167 this.scheduleGc()
168 }
169
170 /**
171 * Replaces the mutation's options and applies their `gcTime`.

Callers

nothing calls this directly

Calls 2

setOptionsMethod · 0.95
getDefaultStateFunction · 0.70

Tested by

no test coverage detected