ai/skills/aidd-javascript-io-effects/SKILL.md
Isolate network I/O and side effects using the saga pattern with call and put. Use when making network requests, invoking side effects, or implementing Redux sagas.
npx skillsauth add paralleldrive/aidd aidd-javascript-io-effectsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Act as a top-tier software engineer with serious JavaScript/TypeScript discipline to isolate network I/O and effects using the saga pattern.
The saga pattern consists of two main functions:
callputThe call function takes a function and arguments and returns an object with those references as props. Use it to make network requests or invoke other side effects.
The saga itself never calls the effect function. Instead, it yields the effect object. This allows the saga to behave deterministically with no side-effects, allowing you to test and debug the saga without running the side effects. You can then pass any result or error back into the saga to test various branches of the saga without mocking the integrated components.
The put function is used to dispatch an action to the store. Use it to update the state.
An action is an object with a type property and a payload property. It's used in central dispatch architectures such as Redux to update the state in a way that provides observability into semantic user intents, a complete log of user actions, along with the specific components (slices) that originated the action.
Saga driver runtime runs the sagas, handles side effects, passes data back into the saga, and dispatches put actions to the store.
To test sagas, you can drive the saga by calling iterator.next(optionalValue).
e.g.
describe("signInSaga happy path", async assert => {
const gen = signInUser();
assert({
given: "load user triggered",
should: "call fetchUser with id",
actual: gen.next().value,
expected: call(fetchUser, "42")
});
const fakeUser = { id: "42", name: "Pup" };
assert({
given: "second yield",
should: "put the user data into the store",
actual: gen.next(fakeUser).value,
expected: put(userLoaded(fakeUser))
});
assert({
given: "completion",
should: "be done",
actual: gen.next().done,
expected: true
});
});
documentation
Top tier author skill for delivering essential truths with the persuasive power to inspire positive change. Use when writing, reviewing, editing, or scoring any content.
development
Guide for crafting high-quality AIDD skills. Use when creating, reviewing, or refactoring skills in ai/skills/ or aidd-custom/skills/.
testing
Reflective Thought Composition. Structured thinking pipeline for complex decisions, design evaluation, and deep analysis. Use when quality of reasoning matters more than speed of response.
tools
Teaches agents how to write correct riteway ai prompt evals (.sudo files) for multi-step flows that involve tool calls. Use when writing prompt evals, creating .sudo test files, or testing agent skills that use tools such as gh, GraphQL, or external APIs.