Javascript 如何更新和删除redux状态缩减器

Javascript 如何更新和删除redux状态缩减器,javascript,reactjs,redux,updates,Javascript,Reactjs,Redux,Updates,当我移动一个用户时,我想更新新组reducer并删除旧组中的用户 /mystate // groups: [ // { // users: [ // '1A', // '1B' // ], // id: '2', // name: 'shoes' // }, // { // users: [], // id: '1', // name: 't-shirt' // } // ] 我的减速器显示了这一点

当我移动一个用户时,我想更新新组reducer并删除旧组中的用户

/mystate
// groups: [
//   {
//     users: [
//       '1A',
//       '1B'
//     ],
//     id: '2',
//     name: 'shoes'
//   },
//   {
//     users: [],
//     id: '1',
//     name: 't-shirt'
//   }
// ]
我的减速器显示了这一点,我不知道如何更新数据

  //in action get id groups and group with id users
  // {
  //   type: 'UPDATE_GROUP',
  //   id: '1A',
  //   group: [
  //     '1'
  //   ]
  // }
  switch (action.type) {
    case UPDATE_GROUP:
      return {
        ...state,
        shop: {
          ...state.shop,
          groups: state.shop.groups ????
        }
      };
    default:
      return state;
  }
}```