UNPKG

@techsio/storefront-data

Version:

Medusa-first storefront data layer built on TanStack Query.

10 lines (9 loc) • 524 B
import { cache } from "react"; import { makeQueryClient } from "../shared/query-client.js"; const ensureServerEnvironment = ()=>{ const isVitest = "undefined" != typeof process && ("true" === process.env.VITEST || "test" === process.env.NODE_ENV); if ("undefined" != typeof window && !isVitest) throw new Error("[storefront-data] server/get-query-client must not be imported in client code."); }; ensureServerEnvironment(); const getServerQueryClient = cache(()=>makeQueryClient()); export { getServerQueryClient };