zalmoxisus/redux-devtools-extension

Sets aren't properly diffed or displayed

开放

#452 创建于 2018年1月30日

 (1 条评论) (8 个反应) (0 位负责人)JavaScript (1,011 个派生)batch import
help wantedmonitor

仓库指标

星标
 (13,455 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Just wanted to make you aware of a possible bug. When passing a new set as a key of the initial state:

{
  items: new Set()
}

and then later adding to the set like so:

const newItems = new Set(state.items)
newItems.add("newItem")
return {...state, items: newItems}

the redux devtools evaluates the diff as no change, while logging the state shows that an item was added.

Let me know if you want any more details about this bug. I have a workaround that I'm using to log the items when needed, but thought you might want to know.

贡献者指南