DEV Community

Discussion on: React + Redux = React + Context

jdmg94 profile image
José Muñoz

I have a bit of an issue with this 3 lines:

const handlerarr = Object.keys(handlers);
  const modHanlders = {};, i) => (modHanlders[h] = handlers[h](state, setState)));

It could be easily reduced to a single line without mutations:

  const modHandlers = Object.keys(handlers).map(key => handlers[key](state, setState))
droidmakk profile image
Afroze Kabeer Khan. M Author

Could be done, Thanks for that. 😍😍
Changing it right away!