svelte/migration/side-effects

Migrates Svelte component side effects into redux-saga workers with cancellation semantics.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Side effects like $effect blocks, fetches, localStorage writes, timers, and IPC listeners scattered inside Svelte components, stores, and reducers cause duplicate ownership, stale responses, and impure reducers. This Skill moves every such side effect into a redux-saga so reducers stay pure and async flows gain proper cancellation and ordering. ## Core Features & Use Cases - Side Effect Migration Recipes: Convert $effect, fetch, store.subscribe, setTimeout/setInterval, and event listeners into typed-redux-saga workers using takeEvery, takeLatest, delay, and selector channels. - Safe Persistence Helpers: Replace direct localStorage calls with safe saga helpers like setLocalStorageJSON, keeping browser APIs out of components and reducers. - Async Action Flows: Use createAsyncAction with success/failure dispatch inside workers so components never handle async results directly. - Use Case: A component debounces search input with setTimeout and fetches results. Migrate it to a takeLatest saga with delay(300) so stale responses are cancelled and the reducer only receives final results. ## Quick Start Migrate the $effect and fetch logic in my Svelte component into a redux-saga worker following the side-effects migration recipes.

Frequently Asked Questions about svelte/migration/side-effects

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

FAQPage Schema
How do I migrate a Svelte $effect to redux-saga?▼

Replace the $effect with a saga worker triggered by the relevant action, using takeEvery or takeLatest from typed-redux-saga. Move browser calls like localStorage into safe saga helpers such as setLocalStorageJSON instead of calling them directly.

How to replace component fetch calls with sagas?▼

Dispatch a created action from the component and handle the fetch in a takeLatest worker using yield* call(fetch, url), then parse with call([res, "json"]) and dispatch results via put. takeLatest cancels stale requests automatically.

Can reducers perform side effects like localStorage or fetch?▼

No, reducers must stay pure with no fetch, localStorage, clocks, random IDs, or logging. Side effects in reducers hide cancellation and ordering bugs; move them into saga workers that dispatch pure actions instead.

How do I migrate setTimeout debounce to redux-saga?▼

Use takeLatest with a worker that calls yield* delay(ms) before performing the work. Saga cancellation semantics ensure only the latest trigger completes, replacing manual setTimeout debounce logic in components.

What replaces store.subscribe when moving to sagas?▼

Use selector-channel helpers like takeLatestFromSelector or takeEveryFromSelector, which invoke a worker whenever a selector value changes and provide payload and prevPayload. This replaces manual store.subscribe callbacks reacting to state.

Why do duplicate writes happen after migrating side effects?▼

Duplicate writes occur when a component $effect and a saga both handle the same trigger, creating double ownership. Remove the component-side effect entirely once the saga owns that trigger.