TypedEpic<State, Action> class
An wrapper that allows you to create Epics which handle actions of a specific type, rather than all actions.
Example
Stream<dynamic> searchEpic(
// Note: this epic only works with PerformSearchActions
Stream<PerformSearchAction> actions,
EpicStore<State> store,
) {
return actions
.asyncMap((action) =>
api.search(action.searchTerm)
.then((results) => new SearchResultsAction(results))
.catchError((error) => new SearchErrorAction(error)));
}
final epic = new TypedEpic<State, PerformSearchAction>(typedSearchEpic);
Combining Typed Epics
final epic = combineEpics([
new TypedEpic<State, SearchAction>(searchEpic),
new TypedEpic<State, ProfileAction>(profileEpic),
new TypedEpic<State, ChatAction>(chatEpic),
]);
Properties
Methods
-
call(
Stream actions, EpicStore< State> store) → Stream -
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