我使用 ActiveCartService 的“updateEntry”方法来更新购物车的条目。然后触发来自 CartEntryEffects 类的“updateEntry$”效果,返回新的操作。
updateEntry$: Observable = this.actions$.pipe(
ofType(CartActions.CART_UPDATE_ENTRY),
map((action: CartActions.CartUpdateEntry) => action.payload),
concatMap(payload =>
this.cartEntryConnector
.update(payload.userId, payload.cartId, payload.entry, payload.qty)
// should be my logic with payload
.pipe(
map(() => {
return new CartActions.CartUpdateEntrySuccess({
userId: payload.userId,
cartId: payload.cartId,
});
}),
获取此有效载荷的正确方法是什么?或者我可以覆盖这个效果或添加我的逻辑吗?