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

Method constructor

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

setOptionsMethod · 0.95
getQueryCacheMethod · 0.80
getDefaultStateFunction · 0.70

Tested by

no test coverage detected