asyncredux-nonreentrant-mixin

Abort new AsyncRedux dispatches while the same action type is running.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The NonReentrant mixin prevents concurrent execution of the same action type by aborting new dispatches when one is already running, eliminating duplicate API calls and race conditions.

Core Features & Use Cases

  • NonReentrant behavior: Prevents overlapping executions of the same action type by aborting dispatches while an instance is running.
  • Customization: Override nonReentrantKeyParams() to allow different parameters to run concurrently and override computeNonReentrantKey() to coordinate across action types.
  • Practical use cases: Use for form submissions, long-running API calls, and other operations where race conditions could impact data integrity.

Quick Start

Add the NonReentrant mixin to your action class and dispatch as usual. If the action is already running, subsequent dispatches are silently aborted.

Frequently Asked Questions about asyncredux-nonreentrant-mixin

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

FAQPage Schema
How do I prevent concurrent execution of the same AsyncRedux action in Flutter?

To prevent concurrent execution of the same AsyncRedux action in Flutter, apply the NonReentrant mixin to your action class. It overrides abortDispatch to silently abort new dispatches while an instance of that action type is already running, eliminating race conditions.

How can I allow AsyncRedux actions with different parameters to run concurrently?

To allow AsyncRedux actions with different parameters to run concurrently, override the nonReentrantKeyParams() method in your action class. This customization changes the runtime locking behavior so only actions with matching parameters are blocked.

How do I stop duplicate API calls and form submissions during AsyncRedux dispatches?

You can stop duplicate API calls and form submissions during AsyncRedux dispatches by adding the NonReentrant mixin to your action class. It aborts overlapping dispatches while an instance is running, ensuring data integrity for long-running operations.

Can I coordinate non-reentrant locking across different AsyncRedux action types?

Yes, you can coordinate non-reentrant locking across different AsyncRedux action types by overriding the computeNonReentrantKey() method. This allows you to define shared locking logic, preventing concurrent execution across multiple action classes.

Does the NonReentrant mixin require any specific dependencies to work with AsyncRedux?

The NonReentrant mixin requires no external dependencies to work with AsyncRedux. You simply add the mixin to your existing Dart Flutter action class, and it will automatically abort concurrent dispatches of the same action type without extra setup.