Message from JavaScript discussions

July 2018

— Is someone here used to react - redux and can help me?

— 

I have a form with multiple inputs each input subscribes the store and onChange updates the state which then gets saved in the localStorage. Every input is controlled and gets the value from the state. Problem when I type something in the form every input rerenders

— Sabyasachi:
Can anyone suggest me a optimized of converting json to array object. I am using [jsonObject] like for conversion?

Message permanent page

— Uhm

— Wat

— You want to wrap an object in an array?

— Why?

— Coz the map function will take an array and I am receiving a json object

— Use the callback to map instead?

— Instead of:
[obj].map(fn)
Just do:
fn(obj)

— Is your json already an array of objects? Then u can just do

JSON.parse(JSON.stringify(json)).map((obj) => console.log(obj));

Message permanent page

— Why stringify and parse?