mirror of
https://github.com/hanzoai/bootnode.git
synced 2026-10-25 02:31:30 +00:00
- Add k8s configs for production deployment - Use shared postgres/datastore in hanzo namespace - Fix image registry to ghcr.io/hanzoai/bootnode - Add deploy script with shared infra support - Simplify compose.yml for local development
33 lines
739 B
TypeScript
33 lines
739 B
TypeScript
"use client"
|
|
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
|
|
import * as React from "react"
|
|
|
|
function makeQueryClient() {
|
|
return new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: 30_000,
|
|
retry: 1,
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
let browserQueryClient: QueryClient | undefined
|
|
|
|
function getQueryClient() {
|
|
if (typeof window === "undefined") return makeQueryClient()
|
|
if (!browserQueryClient) browserQueryClient = makeQueryClient()
|
|
return browserQueryClient
|
|
}
|
|
|
|
export function Providers({ children }: { children: React.ReactNode }) {
|
|
const queryClient = getQueryClient()
|
|
return (
|
|
<QueryClientProvider client={queryClient}>
|
|
{children}
|
|
</QueryClientProvider>
|
|
)
|
|
}
|