asyncredux-selectors

Create and cache AsyncRedux selectors for derived Flutter AppState data.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers create and cache selectors for efficient state access in AsyncRedux-based Flutter apps, enabling memoization and reducing unnecessary rebuilds.

Core Features & Use Cases

  • Write selector functions to extract derived data from AppState.
  • Cache results using cache1state, cache2states, and related helpers to avoid recomputation on state changes.
  • Reuse in widgets via context.select and WidgetSelect to minimize rebuilds in large lists or dashboards.
  • Use case: Imagine a list of users; the skill provides a cached selector to compute filtered views (e.g., active users) with automatic invalidation when state slices change.

Quick Start

Use a cached selector with cache1state_1param to derive a filtered list and access it in a widget with context.select.

Frequently Asked Questions about asyncredux-selectors

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

FAQPage Schema
How do I cache selectors in AsyncRedux to avoid unnecessary widget rebuilds?

Cache selectors in AsyncRedux using utilities like cache1state and cache2states to memoize derived state. This prevents recomputation during state changes, ensuring widgets only rebuild when the specific selected data actually changes.

What is the best way to compute filtered lists from AppState without degrading Flutter performance?

Computing filtered lists from AppState is best handled by writing cached selector functions. Using helpers like cache1state_1param memoizes the derivation, returning cached results until the relevant state slice changes, which optimizes Flutter performance.

How does context.select work with memoization in AsyncRedux Flutter apps?

The context.select method works with memoization by accessing cached selector functions to read derived data. It ensures that widgets only rebuild when the specific cached output changes, rather than on every AppState update.

Can I use cache2states to derive aggregates from multiple state slices in AsyncRedux?

Yes, you can use cache2states to derive aggregates from multiple state slices in AsyncRedux. It caches the computed result based on two distinct state inputs, automatically invalidating and recomputing only when either of those specific states change.

Do I need to use cache1state for simple state access in AsyncRedux?

You do not need cache1state for simple direct state access in AsyncRedux. It is specifically designed for memoizing computed or derived data, such as filtered lists or aggregates, where avoiding recomputation overhead is critical for performance.