redux-observable – dispatch multiple redux actions in a single epic
There is no requirement that you make a one-to-one in/out ratio. So you can emit multiple actions using mergeMap (aka flatMap) if you need to: const loaded = (results) => ({type: ‘RESULTS_LOADED’, results}); const otherAction = (results) => ({type: ‘MY_OTHER_ACTION’, results}); searchEpic = (action$) => action$ .ofType(‘SEARCH’) .mergeMap( Observable .fromPromise(searchPromise) // Flattens this into two … Read more