asyncredux-sync-actions

Create AsyncRedux synchronous actions that update AppState immediately.

238|39|Updated Aug 4, 2019
One-click install
npx skills add https://github.com/marcglasberg/async_redux --skill asyncredux-sync-actions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: asyncredux-sync-actions
Source: https://github.com/marcglasberg/async_redux/tree/main/.claude/skills/asyncredux-sync-actions
Command: npx skills add https://github.com/marcglasberg/async_redux --skill asyncredux-sync-actions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured approach to implementing synchronous Redux actions in AsyncRedux, ensuring immediate state updates by returning a new AppState from reduce().

Core Features & Use Cases

  • Synchronous state updates: Actions compute and apply a new AppState without awaiting asynchronous operations.
  • Parameterizable actions: Support actions with constructor parameters to update specific state parts.
  • Nested state updates: Demonstrates updating nested state objects via copies.

Quick Start

Create a simple action class extending ReduxAction<AppState> and implement reduce to return the updated state, then dispatch using context.dispatch(...) or context.dispatchSync(...).

Frequently Asked Questions about asyncredux-sync-actions

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

FAQPage Schema
How do I create synchronous AsyncRedux actions in Flutter?

To create synchronous AsyncRedux actions in Flutter, define a class extending ReduxAction<AppState> and implement a non-async reduce() method that returns the new AppState immediately. Dispatch the action using context.dispatch or context.dispatchSync to update the UI.

What is a synchronous ReduxAction used for in AsyncRedux state management?

A synchronous ReduxAction in AsyncRedux state management is used for deterministic, immediate AppState updates without awaiting asynchronous operations. It computes and applies a new state directly in response to straightforward UI events, ensuring fast state changes.

Can I pass parameters to AsyncRedux actions to update nested state?

Yes, you can pass parameters to AsyncRedux actions via the constructor to update specific state parts. The reduce() method can then use these parameters to compute and return a new AppState, including updates to nested state objects via copies.

Does AsyncRedux sync action reduce() method need to be async?

No, the AsyncRedux sync action reduce() method must be non-async. Implementing a synchronous reduce() method that returns the new AppState or null ensures the state update is applied immediately without waiting for asynchronous tasks to complete.

When should I use context.dispatchSync versus context.dispatch for Flutter state updates?

Use context.dispatchSync or context.dispatch for Flutter state updates when triggering synchronous ReduxAction classes. Both methods apply the non-async reduce() result immediately, updating the AppState in response to UI events without introducing asynchronous delays.