I have multiple reducers in my application which are combined in app.reducers.ts. When my action happens state of one reducer should be update with single value from current state of the other reducer(so unplanned delivery will become scheduled) and then remove that value from state of second reducer. Here is how I can delete it, but before doing this I need to update other state.
case UNPLANNED_ACTIONS.REMOVE_UNPLANNED_DELIVERY:
return Object.assign({}, state, {
deliveries: state.deliveries.filter(delivery => delivery.deliveryId !== payload.deliveryId)
});
Calling 2 actions is very bad from application point of view. So I need to somehow handle this on the higher level.