【发布时间】:2020-03-13 03:31:19
【问题描述】:
我想创建一个以数组为参数的动作,但这不进行类型检查:
export const action_organizations_available = createAction(
CoreActionTypes.ORGANIZATIONS_AVAILABLE,
props<Organization[]>()
);
我收到props(): "arrays are not allowed in action creators"。
当类型不是数组时,它可以正常工作。
使用props<{ organizations: Organization[] }> 有效,但我想知道这是否是最佳做法。
当期望数组作为动作中的参数时,最佳做法是什么?
【问题讨论】:
标签: angular ngrx ngrx-store