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

Method reset

packages/query-core/src/query.ts:461–464  ·  view source on GitHub ↗

* Resets the query back to its initial state (the state it had when it was * first created, e.g. any `initialData`), destroying it first to cancel any * in-flight fetch.

()

Source from the content-addressed store, hash-verified

459 * in-flight fetch.
460 */
461 reset(): void {
462 this.destroy()
463 this.setState(this.resetState)
464 }
465
466 /**
467 * Returns `true` if the query has at least one observer for which `enabled`

Callers 12

setupDevtoolsFunction · 0.45
resetFunction · 0.45
PageFunction · 0.45
resetQueriesMethod · 0.45
query.test.tsxFile · 0.45
resetDemoStateMethod · 0.45
resetDemoStateMethod · 0.45

Calls 2

destroyMethod · 0.95
setStateMethod · 0.95

Tested by 1

PageFunction · 0.36