From 94731edafcf296e82b8e8ab5375580f439bc3420 Mon Sep 17 00:00:00 2001 From: Hermann_Kitio Date: Fri, 17 Apr 2026 17:42:28 +0300 Subject: [PATCH] refactor(shared): extraire QueryClient dans shared/lib/query-client.ts --- src/app/providers.tsx | 12 ++---------- src/shared/lib/query-client.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 src/shared/lib/query-client.ts diff --git a/src/app/providers.tsx b/src/app/providers.tsx index b55ca21..1a6feff 100644 --- a/src/app/providers.tsx +++ b/src/app/providers.tsx @@ -1,16 +1,8 @@ -import { QueryClient, QueryClientProvider } from '@tanstack/react-query' +import { QueryClientProvider } from '@tanstack/react-query' import { BrowserRouter } from 'react-router-dom' +import { queryClient } from '@/shared/lib/query-client' import { AppRouter } from './router' -const queryClient = new QueryClient({ - defaultOptions: { - queries: { - staleTime: 5 * 60 * 1000, - retry: false, - }, - }, -}) - export function Providers() { return ( diff --git a/src/shared/lib/query-client.ts b/src/shared/lib/query-client.ts new file mode 100644 index 0000000..bbe7279 --- /dev/null +++ b/src/shared/lib/query-client.ts @@ -0,0 +1,10 @@ +import { QueryClient } from '@tanstack/react-query' + +export const queryClient = new QueryClient({ + defaultOptions: { + queries: { + staleTime: 5 * 60 * 1000, + retry: false, + }, + }, +})