File tree Expand file tree Collapse file tree 3 files changed +64
-5
lines changed
Expand file tree Collapse file tree 3 files changed +64
-5
lines changed Original file line number Diff line number Diff line change 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 }
Original file line number Diff line number Diff line change 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!
Original file line number Diff line number Diff 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```
You can’t perform that action at this time.
0 commit comments