Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

QueryClientProvider.svelte

19 lines354 Bytes

1<script lang="ts">
2 import { onDestroy, onMount } from 'svelte'
3 import { QueryClient } from '@tanstack/query-core'
4 import { setQueryClientContext } from './context'
5​
6 export let client = new QueryClient()
7​
8 onMount(() => {
9 client.mount()
10 })
11​
12 setQueryClientContext(client)
13​
14 onDestroy(() => {
15 client.unmount()
16 })
17</script>
18​
19<slot />