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

Method constructor

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

Source from the content-addressed store, hash-verified

244 #abortSignalConsumed: boolean
245
246 constructor(config: QueryConfig<TQueryFnData, TError, TData, TQueryKey>) {
247 super()
248
249 this.#abortSignalConsumed = false
250 this.#defaultOptions = config.defaultOptions
251 this.setOptions(config.options)
252 this.observers = []
253 this.#client = config.client
254 this.#cache = this.#client.getQueryCache()
255 this.queryKey = config.queryKey
256 this.queryHash = config.queryHash
257 this.#initialState = getDefaultState(this.options)
258 this.state = config.state ?? this.#initialState
259 this.scheduleGc()
260 }
261 /**
262 * The `meta` object passed in the query's options, if any.
263 */

Callers

nothing calls this directly

Calls 3

setOptionsMethod · 0.95
getQueryCacheMethod · 0.80
getDefaultStateFunction · 0.70

Tested by

no test coverage detected