Skip to content

Commit 6120330

Browse files
authored
Merge branch 'main' into package-script-restructure
2 parents 85b12f4 + 2e9d2a9 commit 6120330

File tree

3 files changed

+64
-5
lines changed

3 files changed

+64
-5
lines changed

docs/config.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,47 @@
690690
{
691691
"label": "Overview",
692692
"to": "svelte/overview"
693+
},
694+
{
695+
"label": "Installation",
696+
"to": "svelte/installation"
697+
}
698+
]
699+
},
700+
{
701+
"label": "Examples",
702+
"children": [
703+
{
704+
"label": "Simple",
705+
"to": "svelte/examples/svelte/simple"
706+
},
707+
{
708+
"label": "Basic",
709+
"to": "svelte/examples/svelte/basic"
710+
},
711+
{
712+
"label": "Auto Refetching / Polling / Realtime",
713+
"to": "svelte/examples/svelte/auto-refetching"
714+
},
715+
{
716+
"label": "Optimistic Updates in TypeScript",
717+
"to": "svelte/examples/svelte/optimistic-updates-typescript"
718+
},
719+
{
720+
"label": "Playground",
721+
"to": "svelte/examples/svelte/playground"
722+
},
723+
{
724+
"label": "Star Wars",
725+
"to": "svelte/examples/svelte/star-wars"
726+
},
727+
{
728+
"label": "Infinite Queries",
729+
"to": "svelte/examples/svelte/infinite-loadmore"
730+
},
731+
{
732+
"label": "Hydration",
733+
"to": "svelte/examples/svelte/hydration"
693734
}
694735
]
695736
}

docs/svelte/installation.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
id: installation
3+
title: Installation
4+
---
5+
6+
You can install Svelte Query via [NPM](https://npmjs.com).
7+
8+
### NPM
9+
10+
```bash
11+
$ npm i @tanstack/svelte-query
12+
# or
13+
$ pnpm add @tanstack/svelte-query
14+
# or
15+
$ yarn add @tanstack/svelte-query
16+
```
17+
18+
> Wanna give it a spin before you download? Try out the [basic](/query/v4/docs/svelte/examples/svelte/basic) example!

docs/svelte/overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Include the QueryClientProvider near the root of your project:
1212
```svelte
1313
<script lang="ts">
1414
import { QueryClientProvider, QueryClient } from '@tanstack/svelte-query'
15-
import Simple from './lib/Example.svelte'
15+
import Example from './lib/Example.svelte'
1616
1717
const queryClient = new QueryClient()
1818
</script>
1919
2020
<QueryClientProvider client={queryClient}>
21-
<Simple />
21+
<Example />
2222
</QueryClientProvider>
2323
```
2424

@@ -40,9 +40,9 @@ Then call any function (e.g. createQuery) from any component:
4040
{:else if $query.isError}
4141
<p>Error: {$query.error.message}</p>
4242
{:else if $query.isSuccess}
43-
{#each $query.data as todo}
44-
<p>{todo.title}</p>
45-
{/each}
43+
{#each $query.data as todo}
44+
<p>{todo.title}</p>
45+
{/each}
4646
{/if}
4747
</div>
4848
```

0 commit comments

Comments
 (0)