Open History to see the last commit
1<script lang="ts">
2 import { QueryClient } from '@tanstack/query-core'
3 import { onDestroy, onMount } from 'svelte'
4 import { setQueryClientContext } from './context.js'
5 import type { QueryClientProviderProps } from './types.js'
6β
7 const { client = new QueryClient(), children }: QueryClientProviderProps =
8 $props()
9β
10 onMount(() => {
11 client.mount()
12 })
13β
14 setQueryClientContext(client)
15β
16 onDestroy(() => {
17 client.unmount()
18 })
19</script>
20β
21{@render children()}