File: playground.md | Updated: 11/15/2025
Search...
+ K
Auto
Docs Examples GitHub Contributors
Docs Examples GitHub Contributors
Docs Examples GitHub Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Docs Examples Github Contributors
Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide
Documentation
Framework
Svelte
Version
Latest
Search...
+ K
Menu
Getting Started
API Reference
ESLint
Examples
Framework
Svelte
Version
Latest
Menu
Getting Started
API Reference
ESLint
Examples
Svelte Example: Playground
=======================================================================================================================================================================================================================================================================================================================================================================================================================
Code ExplorerCode
Interactive SandboxSandbox
src
lib
routes
+layout.svelte
+page.svelte
AddTodo.svelte
App.svelte
EditTodo.svelte
TodosList.svelte
app.css
app.d.ts
app.html
static
.gitignore
README.md
package.json
svelte.config.js
tsconfig.json
vite.config.ts
svelte
<script lang="ts">
import { useQueryClient } from '@tanstack/svelte-query'
import TodosList from './TodosList.svelte'
import EditTodo from './EditTodo.svelte'
import AddTodo from './AddTodo.svelte'
import { views, editingIndex } from '../lib/stores.svelte'
const queryClient = useQueryClient()
</script>
<div>
<div>
<button onclick={() => queryClient.invalidateQueries()}>
Force Refetch All
</button>
</div>
<br />
<hr />
{#each views.value as view}
<div>
<TodosList initialFilter={view} />
<br />
</div>
{/each}
<button
onclick={() => {
views.value.push('')
}}
>
Add Filter List
</button>
<hr />
{#if editingIndex.value !== null}
<EditTodo />
<hr />
{/if}
<AddTodo />
</div>
<script lang="ts">
import { useQueryClient } from '@tanstack/svelte-query'
import TodosList from './TodosList.svelte'
import EditTodo from './EditTodo.svelte'
import AddTodo from './AddTodo.svelte'
import { views, editingIndex } from '../lib/stores.svelte'
const queryClient = useQueryClient()
</script>
<div>
<div>
<button onclick={() => queryClient.invalidateQueries()}>
Force Refetch All
</button>
</div>
<br />
<hr />
{#each views.value as view}
<div>
<TodosList initialFilter={view} />
<br />
</div>
{/each}
<button
onclick={() => {
views.value.push('')
}}
>
Add Filter List
</button>
<hr />
{#if editingIndex.value !== null}
<EditTodo />
<hr />
{/if}
<AddTodo />
</div>
[###### Want to Skip the Docs?
Query.gg - The Official React Query Course
\
“If you’re serious about *really* understanding React Query, there’s no better way than with query.gg”—Tanner Linsley
Learn More](https://query.gg/?s=tanstack)
