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

Method constructor

packages/query-core/src/query.ts:179–193  ·  view source on GitHub ↗
(config: QueryConfig<TQueryFnData, TError, TData, TQueryKey>)

Source from the content-addressed store, hash-verified

177 #abortSignalConsumed: boolean
178
179 constructor(config: QueryConfig<TQueryFnData, TError, TData, TQueryKey>) {
180 super()
181
182 this.#abortSignalConsumed = false
183 this.#defaultOptions = config.defaultOptions
184 this.setOptions(config.options)
185 this.observers = []
186 this.#client = config.client
187 this.#cache = this.#client.getQueryCache()
188 this.queryKey = config.queryKey
189 this.queryHash = config.queryHash
190 this.#initialState = getDefaultState(this.options)
191 this.state = config.state ?? this.#initialState
192 this.scheduleGc()
193 }
194 get meta(): QueryMeta | undefined {
195 return this.options.meta
196 }

Callers

nothing calls this directly

Calls 3

setOptionsMethod · 0.95
getQueryCacheMethod · 0.80
getDefaultStateFunction · 0.70

Tested by

no test coverage detected