My current effect code is like that here is my effect code in which currently i am dispatching single action from effect. But i want to dispatch one more action notificationNew() which i have commented in below effect code.
bookPropertyRequest$ = createEffect(() => {
return this.actions$.pipe(
ofType(ReservationReqActions.bookPropertyRequest),
concatMap(action =>
this.ReservationReqService.sendReservationRequest(action.reservationRequest).pipe(
map(response => {
if (response.status) {
this.helperService.snackbar('Request Sent.');
// Here i want to dispatch another action - notificationNew()
return ReservationReqActions.bookPropertyRequestSuccess({ reservationRequest: response.result });
} else {
const errorCode = response.errorCode;
if (errorCode !== null) {
this.helperService.errorAlert('', response.message, 'error');
return ReservationReqActions.bookPropertyRequestFailure({
error: {
type: response.errorCode || null,
message: response.message
}
});
}
}
}),
catchError(error => EMPTY)
)
)
);
});
Now I want to dispatch another action from action notificationNew() when the above-mentioned effect is success. So my my concern is how we can dispatch multiple actions from single effect.
So how to achieve this?