Files
upstream-mirror 3a013ccdfe
Some checks failed
autofix.ci / autofix (push) Failing after 4s
Release / Release (push) Has been skipped
GitHub Actions Security Analysis / Run zizmor (push) Failing after 2s
snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
2026-09-16 01:13:08 +05:00

25 lines
719 B
Svelte

<script lang="ts">
import type { QueryClient } from '@tanstack/query-core'
import { createQuery, setQueryClientContext } from '../../src/index.js'
import type { Accessor, CreateQueryOptions } from '../../src/index.js'
type Data = { name: string }
type Props = {
queryClient: QueryClient
options: Accessor<CreateQueryOptions<Data, Error, string>>
}
let { queryClient, options }: Props = $props()
setQueryClientContext(queryClient)
const query = createQuery<Data, Error, string>(options)
</script>
<div data-testid="status">{query.status}</div>
<div data-testid="data">{query.data ?? 'undefined'}</div>
<div data-testid="error">
{(query.error as Error | null)?.message ?? 'null'}
</div>