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

Method setState

packages/query-core/src/query.ts:249–251  ·  view source on GitHub ↗
(state: Partial<QueryState<TData, TError>>)

Source from the content-addressed store, hash-verified

247 }
248
249 setState(state: Partial<QueryState<TData, TError>>): void {
250 this.#dispatch({ type: 'setState', state })
251 }
252
253 cancel(options?: CancelOptions): Promise<void> {
254 const promise = this.#retryer?.promise

Callers 15

setOptionsMethod · 0.95
resetMethod · 0.95
fetchMethod · 0.95
setupDevtoolsFunction · 0.80
triggerErrorFunction · 0.80
QueryDetailsFunction · 0.80
buildQueryFunction · 0.80
utils.test.tsFile · 0.80
makeStateFunction · 0.80
Devtools.test.tsxFile · 0.80
resetErrorBoundaryMethod · 0.80

Calls 1

#dispatchMethod · 0.95

Tested by 4

buildQueryFunction · 0.64
makeStateFunction · 0.64
resetErrorBoundaryMethod · 0.64
componentDidUpdateMethod · 0.64