()
| 8 | let browserQueryClient: QueryClient | undefined; |
| 9 | |
| 10 | export function getQueryClient(): QueryClient { |
| 11 | if (isServer) { |
| 12 | // Server: always make a new query client |
| 13 | return makeQueryClient(); |
| 14 | } |
| 15 | // Browser: make a new query client if we don't already have one |
| 16 | // This is very important, so we don't re-make a new client if React |
| 17 | // suspends during the initial render. This may not be needed if we |
| 18 | // have a suspense boundary BELOW the creation of the query client |
| 19 | if (!browserQueryClient) { |
| 20 | browserQueryClient = makeQueryClient(); |
| 21 | } |
| 22 | return browserQueryClient; |
| 23 | } |
nothing calls this directly
no test coverage detected