svelte/selectors

Creates Store-bound memoized selectors for derived state in Svelte and Redux applications.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Derived values like filtered lists, counts, and entity lookups often get duplicated across components or stored redundantly in reducer state, causing inconsistency and wasted computation. This Skill guides the creation of cached, composable selectors through store.createSelector so derived state has one canonical, testable implementation. ## Core Features & Use Cases - Store-bound selector factories: Create app-local selectors with store.createSelector(...) that preserve StoreState type inference and return Svelte readables. - Multiple call modes: Use the readable form in component init, .select(state, args) in tests and composition, .effect(args) in sagas, and .withStore(store) for SSR contexts. - Collection-backed lookups: Combine selectors with getItem and getItems collection utilities for O(1) entity access and ordered materialization. - Use Case: When building a todo list view that shows only visible items, define selectVisibleTodos once, compose it from selectAllTodos and selectTodoFilter via .select(state), and reuse it in components, sagas, and tests without duplicating logic. ## Quick Start Ask the AI to create a memoized selector with store.createSelector that derives a filtered todo list from the existing todos collection and filter state.

Frequently Asked Questions about svelte/selectors

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

FAQPage Schema
How do I create a memoized selector in a Svelte Redux store?▼

Use store.createSelector with a callback that reads from the store state, such as (state) => state.todos.collection.ids.length. The returned selector caches results per store instance and arguments, and calling it in component init returns a Svelte readable.

How to read selector values inside redux-saga effects?▼

Use the selector's .effect(args) form with yield* inside sagas instead of inline select lambdas. This keeps the read named, cached, and testable while the saga context supplies the Redux store.

Can I pass object arguments to a cached selector?▼

Object arguments are valid only when their identity is stable, such as a module constant or memoized config. Prefer primitive scalar arguments like ids, booleans, or enum strings so repeated calls share stable cache keys.

Should derived state be stored in Redux reducers or selectors?▼

Derived values belong in selectors, not reducer state. Keep reducers holding canonical data and expose computed values like filtered lists or counts through store.createSelector so there is one canonical implementation.

Why does calling a selector readable inside a handler fail?▼

The readable form selectFoo(args) requires Svelte component init context to establish the store subscription. In handlers, tests, or callbacks, use selectFoo.select(state, args) or selectFoo.withStore(store)(args) instead.