EffectExecutor class
Executor for running effects outside reducer.
Key responsibilities:
- Deduplicate effects with same key within batch (last wins)
- Coalesce effects when Effect.coalescable is true
- Cancel pending effects by key
- Dispatch result events asynchronously (microtask) to prevent recursion
Usage:
final executor = EffectExecutor(
onResult: (result) => dispatch(ResultEvent(result)),
);
// From reducer: return effects
executor.execute([
OpenOverlayEffect(...),
FetchDataEffect(...),
]);
See docs/ARCHITECTURE.md → "Единый стандарт поведения… (E1)"
Constructors
- EffectExecutor({required EffectResultCallback onResult})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
EffectKey key) → void - Cancel pending effect(s) by key.
-
dispose(
) → void - Dispose executor and cancel all pending operations.
-
execute(
List< Effect> effects) → void - Execute a batch of effects.
-
isPending(
EffectKey key) → bool - Check if an effect with given key is pending.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited