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

Function getQueryClientContext

packages/svelte-query/src/context.ts:8–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7/** Retrieves a Client from Svelte's context */
8export const getQueryClientContext = (): QueryClient => {
9 const client = getContext<QueryClient | undefined>(_contextKey)
10 if (!client) {
11 throw new Error(
12 'No QueryClient was found in Svelte context. Did you forget to wrap your component with QueryClientProvider?',
13 )
14 }
15
16 return client
17}
18
19/** Sets a QueryClient on Svelte's context */
20export const setQueryClientContext = (client: QueryClient): void => {

Callers 1

useQueryClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected