Asyncredux state design

From marcglasberg/async_redux · View interactive version

Asyncredux state design is an AI agent skill from the GitHub repository marcglasberg/async_redux. Design immutable AsyncRedux app state, including nested state, collection updates, and domain methods.

How to use this skill

Skill file

Design immutable state

state objects. Give it a named initial state when initialization warrants it.

recommend IList, IMap, and ISet from fast_immutable_collections. With

standard Dart collections, store immutable copies so callers cannot mutate state.

those operations. Keep services, streams, and timers in dependencies or store props.

distinguish clearing from an omitted argument. Preserve unchanged substate instances

when copying so widgets can select them efficiently.

import 'package:fast_immutable_collections/fast_immutable_collections.dart';

class Todo {
  const Todo(this.title);
  final String title;
}

class TodoState {
  const TodoState({this.todos = const IList<Todo>.empty()});
  final IList<Todo> todos;

  TodoState add(Todo todo) => TodoState(todos: todos.add(todo));
}

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.