asyncredux-state-design

Design immutable AppState classes with final fields, initialState(), and copy() methods.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables developers to design immutable AppState models for AsyncRedux, ensuring that state is never mutated in place and changes yield new instances.

Core Features & Use Cases

  • Final fields and a static initialState() factory to provide default values.
  • copy() methods to create modified state instances without mutating the original.
  • Nested state composition (e.g., AppState with TodoList, User, Settings) with consistent initialState() and copy() implementations.
  • Optional integration with fast_immutable_collections for IList, ISet, and IMap to manage collections efficiently.

Quick Start

Define a sample AppState with final fields and a static initialState() method. Implement a copy() method to produce new instances without mutating the original. Show a nested example by including TodoList and User inside AppState to demonstrate composition.

Frequently Asked Questions about asyncredux-state-design

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

FAQPage Schema
How do I design immutable AppState classes for AsyncRedux?

To design immutable AppState for AsyncRedux, use final fields, a static initialState() factory for defaults, and a copy() method to generate new instances without mutating the original state.

How does the copy() pattern work with nested state objects in Flutter?

The copy() pattern for nested state objects in Flutter creates new parent and child instances during modifications, ensuring nested composition like User or TodoList inside AppState remains immutable.

What is the best way to manage collections in immutable Flutter AppState?

The best way to manage collections in immutable Flutter AppState is using fast_immutable_collections, integrating IList, ISet, and IMap to efficiently handle collection updates without mutating existing state.

Do I need fast_immutable_collections to use AsyncRedux state design?

You do not need fast_immutable_collections to use AsyncRedux state design, as integration with IList, ISet, and IMap is optional, allowing final fields and copy() methods to manage state independently.

Why use a static initialState() factory instead of a default constructor for AppState?

Use a static initialState() factory instead of a default constructor for AppState to provide standardized default values, ensuring the AsyncRedux store initializes with a clean, immutable state instance.