Can I listen to multiple actions, instead of just one?
Right now, to achieve that, I'm doing it in multiple epics, using combineEpics
helper:
combineEpics(
action$ => action$.ofType("SOME_TYPE_A").mapTo(newAction),
action$ => action$.ofType("SOME_TYPE_B").mapTo(newAction)
);
However, I can use filter
instead:
action$ =>
action$
.filter(({ type }) => type === "SOME_TYPE_A" || type === "SOME_TYPE_B")
.mapTo(newAction);
But it's not scalable, when I need to listen for 5 actions, for example.
Is there exists more elegant way to listen multiple actions?