更新时间:2023-11-17 15:43:34
具有2个单独的效果源就可以了.否则就简单点:
Having 2 separate effect sources are fine. Otherwise make it simple:
@Effect() foo$ = this.updates$
.whenAction(Actions.FOO)
.map(({action, state}) => {
if (state.product.foo) {
return { type: Actions.CHAT_GET_MESSAGES2, payload: { action.payload }};
} else {
return { type: Actions.CHAT_GET_MESSAGES, payload: { action.payload }};
}
});