feat: add query provider for Tanstack
This commit is contained in:
17
src/app/providers/QueryProvider.svelte
Normal file
17
src/app/providers/QueryProvider.svelte
Normal 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>
|
||||
Reference in New Issue
Block a user