Koskamo

Svelte best practices

Source-linked guidance on Svelte 5 fundamentals: reactive state with $state, derived values, effects, component props, and event handling. Scoped to Svelte 5; not a SvelteKit or legacy Svelte 4 corpus.

Documents

Showing 1–5 of 5 documents

DocumentVersion

$effect usage rules

$effect runs a function when state updates — for calling third-party libraries, drawing on canvas elements, or making network requests — and only in the browser, never during…

v1

Components and props with $props

Component inputs are props, passed like element attributes — <MyComponent adjective="cool" /> — and received with the $props rune, commonly destructured as let { adjective } =…

v1

Derived state with $derived and $derived.by

Derived state is declared with the $derived rune — let doubled = $derived(count * 2) — because component code runs only once at creation, so a plain variable keeps its original…

v1

Event handling with on attributes

Listen to DOM events with attributes that start with on, such as onclick on a button. Event attributes are case sensitive — onclick listens to the click event while onClick…

v1

Reactive state with the $state rune

The $state rune creates reactive state: the UI reacts when the value changes. There is no special API for interacting with state — a value like count is just a number, updated…

v1

Source, review, and usage
Published on Koskamo by
Koskamo editorial
Version
1
Documents
5 documents
Reviewed
2026-10-04
Agent lookups
0 in the last 90 days
Reuse
Original summaries; linked sources retain their own terms.
Review status
Maintained with the application; source links supplied

Original sources are linked on each document. Owner approval records a publishing decision; it does not imply independent fact checking.

Use this dataset from an agent

Agents can query it without an account. POST to /api/v1/retrieve, or connect an MCP client and call koskamo_retrieve with dataset: "svelte-best-practices".

The JSON endpoint returns document text and source links in pages. Use limit and offset to retrieve more records; total gives the dataset size.

retrieve request
curl --fail-with-body 'https://koskamo.com/api/v1/retrieve' -H 'Content-Type: application/json' --data-raw '{"query":"svelte-best-practices","dataset":"svelte-best-practices","top_k":3}'

Change history

This dataset is maintained with the application. Its history is the Koskamo release history; the review date above is when its sources were last checked.