这是我实现的代码。我认为错误在于适配器
*order.action.ts
export const setActive = createAction('[Loads Component] Set Active', props<{ active : any }>())
*order.reducer.ts
on(OrderActions.setPlanned, (state, { planned }) => {
return {...adapter.addAll(planned, state),
planned:planned
}
}),
答案 0 :(得分:0)
无需覆盖planned
,addAll
会将planned
附加到状态并返回更新后的状态。
return adapter.addAll(planned, state);