Svelte 5
simple-svelte-query
A query cache that stores Promises, not snapshots.
Native await flows, zero boilerplate.
Install
Pick your package manager and copy the command.
$
bun add simple-svelte-queryDocumentation
Read the docs →Go straight to the API reference and examples.
01
Promise cache
Stores the Promise itself. Compose with await, get predictable concurrent behavior.
02
Hierarchical keys
Precise invalidation by exact key or broad invalidation by prefix. Familiar model.
03
AbortSignal
Cancellation support passed directly to your query function. Aligned with fetch.
Quick start
<script lang="ts">
import { QueryClient } from 'simple-svelte-query';
const queryClient = new QueryClient();
let search = $state('phone');
const productsQuery = queryClient.createQuery(() => ({
queryKey: ['products', search],
queryFn: ({ signal }) =>
fetch('/api/products?q=' + search, { signal })
.then((r) => r.json())
}));
</script>
<ul style:opacity={productsQuery.pending ? 0.4 : 1}>
{#each (await productsQuery).items as item (item.name)}
<li>{item.name}</li>
{/each}
</ul>