redux-data-structures icon indicating copy to clipboard operation
redux-data-structures copied to clipboard

Help request: Map implementation

Open fosteman opened this issue 6 years ago • 0 comments

I am trying to implement set serialization, and have checkout out yours, though did not understand it. How does it work ? My aim is to have one of my reducers populate and read stateful Map in Redux Store, how would I do that ?

const reducer = (state = {
  statefulMap: new Map()
}, action) => {
switch
    case: {
      let newMap = new Map(state.statefulMap)
      action.newObjects.forEach(newMap.set(`${p.id},${p.search_keyword}`, 
      return Object.
return {
          statefulMap: newMap
        }
    }

Thanks for any thoughts.

fosteman avatar Sep 17 '19 17:09 fosteman