19 lines
596 B
TypeScript
19 lines
596 B
TypeScript
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
import type { PropsWithChildren } from 'react';
|
|
import { DashboardRealtimeProvider } from './realtime-provider.js';
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: 15_000,
|
|
retry: 1,
|
|
refetchOnWindowFocus: false,
|
|
},
|
|
mutations: { retry: false },
|
|
},
|
|
});
|
|
|
|
export function AppProviders({ children }: PropsWithChildren) {
|
|
return <QueryClientProvider client={queryClient}><DashboardRealtimeProvider>{children}</DashboardRealtimeProvider></QueryClientProvider>;
|
|
}
|