svelte/store

Guides Svelte-readable Store imports, initialization, disposal, and saga lifecycle in Svelte components.

6|6|Updated Jun 29, 2026
One-click install
npx skills add https://github.com/intent-hq/cloudlands-fe --skill svelte-store-intent-hq
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: svelte/store
Source: https://github.com/intent-hq/cloudlands-fe/tree/main/.agents/skills/themis/svelte/store
Command: npx skills add https://github.com/intent-hq/cloudlands-fe --skill svelte-store-intent-hq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers using the @augmentcode/themis state library in Svelte apps often import Store from the wrong subpath, call selectors before initialization, or double-initialize nested stores, causing runtime errors and broken reactivity. ## Core Features & Use Cases - Correct Import Guidance: Enforces importing Store from @augmentcode/themis/svelte-store and lifecycle helpers from leaf subpaths like components-svelte/use-init-store. - Lifecycle Rules: Documents init(), dispose(), dispatch, state, and runSaga() behavior, including the noop disposer returned when a store context already exists. - Component Helpers: Covers useInitStore and useRunSaga for mount/destroy-bound store and saga management in root layouts. - Use Case: When wiring a root Svelte layout, use this guidance to initialize the Store with useInitStore, start sagas with useRunSaga, and bind $selector$ readables in templates without pre-init errors. ## Quick Start Ask the AI to set up a Svelte root layout that initializes a themis Store with useInitStore and starts a saga with useRunSaga using the correct import subpaths.

Frequently Asked Questions about svelte/store

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I import the Svelte Store from @augmentcode/themis?▼

Import Store from the @augmentcode/themis/svelte-store subpath, not from the package root, src/* paths, or utils/svelte-selectors internals. Lifecycle helpers come from leaf subpaths like @augmentcode/themis/components-svelte/use-init-store.

How to initialize a themis Store in a Svelte component?▼

Call useInitStore(store, initialState) at component init time, typically in the root layout. It calls store.init(initialState) and automatically disposes the store via onDestroy when the component unmounts.

Why does my selector call throw before store init?▼

Direct selector calls throw if invoked before store.init() or after dispose(), because the Svelte Readable outputs are backed by the Store-owned state stream that only exists during the initialized lifecycle.

Can I run redux-saga with the Svelte Store?▼

Yes, use store.runSaga(sagaFn) directly or the useRunSaga(saga) helper from components-svelte/use-run-saga, which starts the saga on mount and stops it on destroy. Call it after the Store is initialized.

What happens if a Store is initialized twice in nested components?▼

If a store context already exists in the Svelte component tree, init() skips setup and returns a noop disposer. This prevents nested Store components from double-initializing shared state.