first commit
This commit is contained in:
10
src/app/config/queryClient.ts
Normal file
10
src/app/config/queryClient.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { QueryClient } from "@tanstack/react-query";
|
||||
|
||||
export const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 60_000,
|
||||
refetchOnWindowFocus: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
5
src/app/config/wsconfig.ts
Normal file
5
src/app/config/wsconfig.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const wsConfig = {
|
||||
infoBar: "ws://100.115.148.59/websocket-infobar",
|
||||
};
|
||||
|
||||
export type SocketKey = keyof typeof wsConfig;
|
||||
7
src/app/providers/AppProviders.tsx
Normal file
7
src/app/providers/AppProviders.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { QueryClientProvider } from "@tanstack/react-query";
|
||||
import { queryClient } from "../config/queryClient";
|
||||
import type { PropsWithChildren } from "react";
|
||||
|
||||
export const AppProviders = ({ children }: PropsWithChildren) => {
|
||||
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
|
||||
};
|
||||
7
src/app/providers/QueryProviders.tsx
Normal file
7
src/app/providers/QueryProviders.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { PropsWithChildren } from "react";
|
||||
import { QueryClientProvider } from "@tanstack/react-query";
|
||||
import { queryClient } from "../config/queryClient";
|
||||
|
||||
export function QueryProvider({ children }: PropsWithChildren) {
|
||||
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
|
||||
}
|
||||
Reference in New Issue
Block a user