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

Method constructor

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

setOptionsMethod · 0.95
getQueryCacheMethod · 0.80
getDefaultStateFunction · 0.70

Tested by

no test coverage detected