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

Method onOnline

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

* Refetches the query when the app reconnects, if an observer wants that, and continues a paused * fetch. * @internal

()

Source from the content-addressed store, hash-verified

601 * @internal
602 */
603 onOnline(): void {
604 const observer = this.observers.find((x) => x.shouldFetchOnReconnect())
605
606 observer?.refetch({ cancelRefetch: false })
607
608 // Continue fetch if currently paused
609 this.#retryer?.continue()
610 }
611
612 /**
613 * Subscribes an observer to the query and stops its garbage collection.

Callers 5

useQuery.test.tsxFile · 0.45
useQuery.test.tsxFile · 0.45
useQuery.test.tsxFile · 0.45
mountMethod · 0.45
query.test.tsxFile · 0.45

Calls 4

refetchMethod · 0.80
continueMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected