feature/fetch-fonts #14

Merged
ilia merged 76 commits from feature/fetch-fonts into main 2026-01-14 11:01:44 +00:00
2 changed files with 43 additions and 0 deletions
Showing only changes of commit 0f1eb489ed - Show all commits

View File

@@ -0,0 +1,17 @@
<script lang="ts">
/**
* Query Provider Component
*
* All components that use useQueryClient() or createQuery() must be
* descendants of this provider.
*/
import { queryClient } from '$shared/api/queryClient';
import { QueryClientProvider } from '@tanstack/svelte-query';
/** Slot content for child components */
let { children } = $props();
</script>
<QueryClientProvider client={queryClient}>
{@render children?.()}
</QueryClientProvider>

View File

@@ -0,0 +1,26 @@
import { QueryClient } from '@tanstack/query-core';
/**
* Query client instance
*/
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
/**
* Default staleTime: 5 minutes
*/
staleTime: 5 * 60 * 1000,
/**
* Default gcTime: 10 minutes
*/
gcTime: 10 * 60 * 1000,
refetchOnWindowFocus: false,
refetchOnMount: true,
retry: 3,
/**
* Exponential backoff
*/
retryDelay: attemptIndex => Math.min(1000 * 2 ** attemptIndex, 30000),
},
},
});