core/selector-channels

Implements redux-saga watchers that react to selector value changes via channel effects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Sagas often need to react to changes in derived Redux state rather than action dispatches, and hand-rolled channel loops are error-prone. This Skill guides the correct choice and safe usage of selector-channel helpers like takeLatestFromSelector, takeEveryFromSelector, takeLeadingFromSelector, and createChannelFromSelector. ## Core Features & Use Cases - Helper Selection: Choose between takeLatest, takeEvery, and takeLeading selector variants based on cancellation semantics, reserving createChannelFromSelector for custom race, timeout, or conditional flows. - Argument and Payload Rules: Pass stable scalar selector args as tuples, import selectors from [slice]-selectors.ts, and handle payload/prevPayload transitions safely. - Use Case: When a todo ID changes in the store, use takeLatestFromSelector(selectTodoById, [todoId], worker) to cancel stale sync work and process only the latest selector emission. ## Quick Start Ask the AI to write a saga that watches a selector with takeLatestFromSelector and dispatches a load action whenever the selected value changes.

Frequently Asked Questions about core/selector-channels

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

FAQPage Schema
How do I make a redux-saga react to selector state changes?▼

Use takeLatestFromSelector, takeEveryFromSelector, or takeLeadingFromSelector from @augmentcode/themis/saga instead of watching actions. Pass the named selector, an optional args tuple, and a worker that receives { payload, prevPayload }.

takeLatestFromSelector vs takeEveryFromSelector: which should I use?▼

takeLatestFromSelector cancels the previous worker on each new emission and suits load or search-on-change flows. takeEveryFromSelector handles every emission independently, while takeLeadingFromSelector ignores new values during in-flight work.

When should I use createChannelFromSelector instead of the take helpers?▼

Use createChannelFromSelector only for custom race, conditional loop, manual cancellation, or timeout flows. For simple load-on-change behavior the take*FromSelector helpers own channel creation and cleanup automatically.

Can I pass object or function arguments to selector-channel helpers?▼

Prefer primitive scalar args in the args tuple, such as [todoId]. Fresh object, array, or function literals break identity comparisons; construct stable references once before the helper call if object-keyed selectors are intentional.

Why must selector channels be closed in a finally block?▼

Raw channels created with createChannelFromSelector keep a store subscription alive until closed. Closing in finally guarantees cleanup on cancellation or error, preventing leaked subscriptions and duplicate watchers.