Skip to content

@slop-ai/svelte

Terminal window
bun add @slop-ai/client @slop-ai/svelte

useSlop(client, pathOrGetter, descriptorFactory)

Section titled “useSlop(client, pathOrGetter, descriptorFactory)”

The Svelte adapter is published as a .svelte.ts entrypoint so rune syntax stays intact for downstream compilation.

<script lang="ts">
useSlop(slop, "notes", () => ({
type: "collection",
props: { count: notes.length },
}));
</script>

The adapter tracks $state dependencies inside the descriptor and unregisters automatically on component destroy.