feat(web): add TanStack Query infrastructure (Phase 0)
- Install @tanstack/react-query v5 + devtools - Create core/query-client.ts with WS-optimized defaults (staleTime: Infinity) - Create QueryProvider and wire into root layout - Add @core/* path alias to tsconfig + vitest - Add useWorkspaceId() bridge hook for query key scoping Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5fe1ec806d
commit
2be9f6cd2f
9 changed files with 108 additions and 6 deletions
18
apps/web/core/query-client.ts
Normal file
18
apps/web/core/query-client.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { QueryClient } from "@tanstack/react-query";
|
||||
|
||||
export function createQueryClient(): QueryClient {
|
||||
return new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: Infinity,
|
||||
gcTime: 10 * 60 * 1000, // 10 minutes
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
retry: 1,
|
||||
},
|
||||
mutations: {
|
||||
retry: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue