Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

438 B
Raw Blame
import {QueryClient} from "@tanstack/react-query";
import {isSsr} from "./helpers.ts";
import {queryClient} from "./queryClient.ts";
import {getSsrRequestContext} from "./ssrRequestContext.ts";

export function getQueryClient(): QueryClient {
    if (isSsr()) {
        const ssrQueryClient = getSsrRequestContext()?.queryClient;
        if (ssrQueryClient) {
            return ssrQueryClient;
        }
    }

    return queryClient;
}