相关疑难解决方法(0)

NGRX/Store有效负载类型混淆

我有以下行动:

export const ActionTypes = {
  CREATE_OH:                  type('[ORDERHEAD] Create Orderhead'),
  MODIFY_SELECTED_OH:    type('[ORDERHEAD] Select Orderhead'),     
};

export class CreateOHAction implements Action {
  type = ActionTypes.CREATE_OH

  constructor(public payload: OrderHead[]) { }
}

export type Actions
  =   CreateOHAction
  |   SelectOHAction;
Run Code Online (Sandbox Code Playgroud)

使用以下基础减速器设置

export interface State {
  orderids: string[];
  entities: { [orderID: string]: OrderHead };
  selectedOhID: string | null;
};

// Set initial state to empty
const initialState: State = {
  orderids : [],
  entities: {},
  selectedOhID: null,

};
export function OHreducer(state = initialState, action: …
Run Code Online (Sandbox Code Playgroud)

typescript ngrx angular

5
推荐指数
1
解决办法
1136
查看次数

标签 统计

angular ×1

ngrx ×1

typescript ×1