core/wait-for

Implements one-shot saga waits on named selector predicates with optional timeouts.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @augmentcode/themis, typed-redux-saga.

What problem does it solve? Redux-saga workflows often need to pause until application state reaches a specific condition, and hand-rolling selector channels or race logic for these one-shot waits is error-prone and duplicated across codebases. ## Core Features & Use Cases - One-Shot Selector Waits: Pause a saga until a named selector matches a pure predicate, using the waitFor(selector, argsTuple, predicate, timeoutMs?) API from @augmentcode/themis/saga. - Timeout Handling: Supply a timeout in milliseconds and branch on the boolean return value to dispatch explicit timeout outcomes. - Correct Argument Patterns: Enforces passing an args tuple ([] for no-arg selectors, scalar args for parameterized selectors) and guards against undefined/null previous values on immediate checks. - Use Case: A publish worker saga waits for selectAuthReady to become true with a 5-second timeout before calling the publish API, dispatching a rejection action if authentication never completes. ## Quick Start Ask the AI to write a saga that uses waitFor to pause until a named selector matches a predicate, with a timeout and a branch handling the timed-out case.

Frequently Asked Questions about core/wait-for

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

FAQPage Schema
How do I make a redux-saga wait for a selector value?▼

Use waitFor from @augmentcode/themis/saga with the signature waitFor(selector, argsTuple, predicate, timeoutMs?). Pass a named selector, an args tuple ([] for no-arg selectors), and a pure predicate; the saga resumes when the predicate matches or the timeout expires.

How do I add a timeout to a saga selector wait?▼

Pass a timeout in milliseconds as the fourth argument to waitFor, then check the boolean return value. A false return means the wait timed out, so dispatch an explicit timeout action before continuing with state-dependent work.

When should I use waitFor instead of a selector channel?▼

Use waitFor for one-shot conditions where the saga proceeds once the predicate matches. For polling or reacting to every future selector change, use takeLatestFromSelector, takeEveryFromSelector, or a selector channel instead.

Why does my waitFor predicate see undefined as the previous value?▼

The immediate check passes undefined as prevVal, and the first selector-channel emission can pass null. Guard previous-value comparisons by checking prevVal is neither undefined nor null before treating a change as a real transition.

Can I pass object arguments to waitFor selector args?▼

Prefer primitive scalar args in the tuple, since fresh object, array, or function literals break selector memoization. Pass object or function args only when their identity is stable and intentional across calls.