()
| 96 | * @returns The single registered query client. |
| 97 | */ |
| 98 | export function useQueryClient(): QueryClient { |
| 99 | const client = getDefaultQueryClient() |
| 100 | if (client) { |
| 101 | return client |
| 102 | } |
| 103 | |
| 104 | if (registeredClients.size > 1) { |
| 105 | throw createAmbiguousQueryClientError() |
| 106 | } |
| 107 | |
| 108 | throw createMissingQueryClientError() |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Resolves an explicit `QueryClient` or falls back to `useQueryClient`. |
no test coverage detected