【发布时间】:2017-04-28 15:42:15
【问题描述】:
我有以下分派 3 个动作的代码:
- deleteLineFailed
- showConfirmationMessage
- 等待 2s
- hideConfirmationMessage
由于某些原因,我能够使其工作的唯一方法是按相反的顺序,我做错了什么?
const deleteLineEpic = (action$, store) =>
action$.ofType(types.DELETE_LINE_REQUEST)
.flatMap((action) => {
return Observable.of(hideConfirmationMessage(action.line.productID))
.delay(2000)
.merge(
Observable.of(deleteLineFailure(action.line.productID)),
Observable.of(showConfirmationMessage(action.line.productID))
);
}
});
【问题讨论】:
标签: redux rxjs5 redux-observable