I did not find in the documentation how one should or _should not_ use things like es6 Map and Set with Redux.
It seems like a new map should be created every time when we 'modify' it in the reducer, but I'm not sure that it is correct.
I don’t think it’s a good idea to use them in Redux because they are optimized for mutability. If you want to have something efficient with similar semantics, consider using Immutable.js.
Can this be mentioned somewhere in the docs, that it is not a good idea? (probably this issue is enough to be googled by keywords)
Yes, I'm not able to use ES6 map it seems it just deal with Objects, and array only.
You _can_ use Maps and Sets as state values, but it's not recommended due to serializability concerns. In addition, the built-in combineReducers utility expects to work with plain JS objects, so if you use a Map as part of your state tree, you would need to use other reducer handling instead of combineReducers.
FYI, I have implemented generic map and set reducers using plain JS objects in redux-data-structures:
https://github.com/adrienjt/redux-data-structures/blob/master/src/reducers/map.js
https://github.com/adrienjt/redux-data-structures/blob/master/src/reducers/set.js
Not sure if this is what @markerikson means by "serializability concerns", but for example if you try to do things like export/import your entire state with json, any maps in your reducer state will not properly be initialized. The basic issue is outlined here: http://2ality.com/2015/08/es6-map-json.html
Most helpful comment
I don’t think it’s a good idea to use them in Redux because they are optimized for mutability. If you want to have something efficient with similar semantics, consider using Immutable.js.