UseQueryClient
katanakit-js / useQueryClient
Function: useQueryClient()
Section titled “Function: useQueryClient()”function useQueryClient(): QueryClient;Defined in: core/services/query.service.ts:193
Returns the shared QueryClient singleton, creating one on first call.
This is a process-global instance: it is the right default in the browser, but on the server it would leak cached data across requests. Use useCreateQueryClient per request when running under SSR.
Returns
Section titled “Returns”QueryClient
The shared QueryClient.
Example
Section titled “Example”import { useQueryClient } from "katanakit-js";
const client = useQueryClient();await client.invalidateQueries({ queryKey: ["users"] });