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

ChildComponent.svelte

14 lines301 Bytes

1<script lang="ts">
2 import { createQuery } from '../../src/index.js'
3 import { sleep } from '../utils.js'
4​
5 const query = createQuery({
6 queryKey: ['hello'],
7 queryFn: async () => {
8 await sleep(5)
9 return 'test'
10 },
11 })
12</script>
13​
14<div>Data: {$query.data ?? 'undefined'}</div>