@Effect() actionX$ = this.updates$ .ofType('ACTION_X') .map(toPayload) .switchMap(payload => this.api.callApiX(payload) .map(data => ({type: 'ACTION_X_SUCCESS', payload: data})) .catch(err => Observable.of({type: 'ACTION_X_FAIL', payload: err})) ); @Effect() actionY$ = this.updates$ .ofType('ACTION_Y') .map(toPayload) .switchMap(payload => this.api.callApiY(payload) .map(data => ({type: 'ACTION_Y_SUCCESS', payload: data})) .catch(err => Observable.of({type: 'ACTION_Y_FAIL', payload: err})) );