Object Redux reducer-对象分解不起作用

Object Redux reducer-对象分解不起作用,object,ecmascript-6,redux,reducers,destructuring,Object,Ecmascript 6,Redux,Reducers,Destructuring,我正在使用以下语法进行对象分解: const { [key]:value, ...allNewUserMsgs } = allUserMsgs 其中(示例) 在控制台手动输入变量时,我会收到正确的结果,其中: allNewUserMsgs == { 0 : {number: 0, text: "Those kumquats are nothing more than bees?", is_user_msg: false}, 1 : {number: 1, text: "A po

我正在使用以下语法进行对象分解:

const { [key]:value, ...allNewUserMsgs } = allUserMsgs
其中(示例)

在控制台手动输入变量时,我会收到正确的结果,其中:

allNewUserMsgs == {
    0 : {number: 0, text: "Those kumquats are nothing more than bees?", is_user_msg: false},
    1 : {number: 1, text: "A polite zebra is a wolf of the mind.", is_user_msg: false},
    3 : {number: 3, text: "A cooperative kitten is an orange of the mind.", is_user_msg: false}
    }
但问题是,在Redux reducer中使用相同的语法时,我收到相同的对象,没有任何更改

这是我的应用程序:

https://glitch.com/edit/#!/understanding-redux-skypey?path=src/reducers/messages.js:58:35
也许,其他代码有问题,但是您可以在右面板中看到添加新消息的其他操作(messages.js中的SEND_message)工作正常(单击联系人查看聊天和输入表单)


我不知道怎么了。代码似乎正常,但由于某些原因无法工作。

即使在浏览器中,我也得到了相同的对象。看看这里:你到底想要实现什么?你只是想从用户消息历史记录中删除一条消息,对吗?Darce,是的-我想从存储状态中删除用户消息。我通过使用lodash库找到了一种方法:
\省略(allUserMsgs,key)
Murli-检查这个,我收到了更改的对象。
https://glitch.com/edit/#!/understanding-redux-skypey?path=src/reducers/messages.js:58:35