Asyncredux sync actions

From marcglasberg/async_redux · View interactive version

Asyncredux sync actions is an AI agent skill from the GitHub repository marcglasberg/async_redux. Implement synchronous AsyncRedux reducers for immediate, immutable state updates.

How to use this skill

Skill file

Write synchronous actions

Extend the app's base action or ReduxAction<AppState>. Override reduce() with

AppState or AppState?. Use current state and immutable constructor arguments.

Return new state when there is a change and null for a no-op. A plain dispatch

applies a synchronous action's change before returning. Keep the full lifecycle

synchronous when callers rely on that timing.

This reducer uses the state and base action from the setup skill.

class IncrementBy extends AppAction {
  IncrementBy(this.amount);
  final int amount;

  @override
  AppState? reduce() {
    if (amount == 0) return null;
    return state.copy(counter: state.counter + amount);
  }
}

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.