📜  当数据是数组时,ngxs 不推送更新状态 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:29.595000             🧑  作者: Mango

代码示例1
// It's not a problem with NGXS, it's the reference of JavaScript objects. Easy solution:

@Selector()
static todos(state: ToDoStateModel): ToDo[] {
  return [...state.todos];
}