Redux-devtools: Doesn't seem to work with Set objects

Created on 14 Aug 2016  路  2Comments  路  Source: reduxjs/redux-devtools

Hey, I was using redux-devtools-extension and it didn't seem to accurately report the contents of my state if the state contained a Set object. For example, if I set the state to

{ mySet: new Set(['1','2','3']) }

the tool seems to think the state is

{ mySet: {} 0 keys }

I'm using chrome 52 and just using console.log(state), it seems that my browser does understand the state to contain the Set object, so I don't think it's a browser issue.

Most helpful comment

The browser does understand it, but JSON.stringify not.
Import set.prototype.tojson polyfill to get it work. Also see the discussion about Map.

All 2 comments

The browser does understand it, but JSON.stringify not.
Import set.prototype.tojson polyfill to get it work. Also see the discussion about Map.

Thanks for the pointer @zalmoxisus.

Was this page helpful?
0 / 5 - 0 ratings