All class

Creates an Effect description that instructs the middleware to run multiple Effects in parallel and wait for all of them to complete.

Example

The following example runs two blocking calls in parallel:

 import 'package:redux_saga/redux_saga.dart';
 import 'fetchApi.dart';

 //...

 mySaga() sync* {
   var result = AllResult();
   yield All(
     {
       #customers: Call(fetchCustomers),
       #products: Call(fetchProducts),
     },
     result: result,
   );
 }

Notes

When running Effects in parallel, the middleware suspends the Generator until one of the following occurs:

  • All the Effects completed with success: resumes the Generator with an array containing the results of all Effects.

  • One of the Effects was rejected before all the effects complete: throws the rejection error inside the Generator.

Inheritance

Constructors

All(Map effects, {AllResult? result})
Creates an instance of a All effect.

Properties

effects Map
Dictionary of all effect to run in parallel.
final
hashCode int
The hash code for this object.
no setterinherited
result Result?
Result after effect is resolved.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getDefinition() Map<String, dynamic>
Returns all properties of effect as a dictionary object
override
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