Download react-query/packages/svelte-query/tests/createQuery/BaseExample.svelte from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/svelte-query/tests/createQuery/BaseExample.svelte
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/svelte-query/tests/createQuery/BaseExample.svelte
-
curl -L -o BaseExample.svelte https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/svelte-query/tests/createQuery/BaseExample.svelte
666 Bytes
| <script lang="ts"> | |
| import { createQuery } from '../../src/index.js' | |
| import type { QueryClient, QueryObserverResult } from '@tanstack/query-core' | |
| import type { Writable } from 'svelte/store' | |
| import type { CreateQueryOptions, StoreOrVal } from '../../src/index.js' | |
| export let options: StoreOrVal<CreateQueryOptions<any>> | |
| export let queryClient: QueryClient | |
| export let states: Writable<Array<QueryObserverResult>> | |
| const query = createQuery(options, queryClient) | |
| $: states.update((prev) => [...prev, $query]) | |
| </script> | |
| <div>Status: {$query.status}</div> | |
| <div>Failure Count: {$query.failureCount}</div> | |
| <div>Data: {$query.data ?? 'undefined'}</div> | |