EpicClass<State> class
abstract
A class that acts as an Epic, transforming one stream of actions into another stream of actions. Generally, Epic functions are simpler, but you may have advanced use cases that require a type-safe class.
Example
class ExampleEpic extends EpicClass<State> {
@override
Stream<dynamic> call(Stream<dynamic> actions, EpicStore<State> store) {
return actions
.where((action) => action is PerformSearchAction)
.asyncMap((action) =>
// Pseudo api that returns a Future of SearchResults
api.search((action as PerformSearch).searchTerm)
.then((results) => new SearchResultsAction(results))
.catchError((error) => new SearchErrorAction(error)));
}
}
- Implementers
Constructors
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
-
call(
Stream actions, EpicStore< State> store) → Stream -
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