MCPcopy
hub / github.com/TanStack/query / useHydrate

Function useHydrate

packages/svelte-query/src/useHydrate.ts:5–15  ·  view source on GitHub ↗
(
  state?: unknown,
  options?: HydrateOptions,
  queryClient?: QueryClient,
)

Source from the content-addressed store, hash-verified

3import type { HydrateOptions, QueryClient } from '@tanstack/query-core'
4
5export function useHydrate(
6 state?: unknown,
7 options?: HydrateOptions,
8 queryClient?: QueryClient,
9) {
10 const client = useQueryClient(queryClient)
11
12 if (state) {
13 hydrate(client, state, options)
14 }
15}

Callers

nothing calls this directly

Calls 2

hydrateFunction · 0.90
useQueryClientFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…