title: Set all radio buttons to false, then set one to true in Redux reducer
body: <p>I can't seem to get my head around how to efficiently set all the radio buttons in a redux state to false then set the original action creator to true.</p>
  
  <p>Right now I struggle by trying to copy the state object using <code>Object.assign</code> whilst also providing a way to change the objects which hold true for <code>item.type === 'radio'</code> to <code>false</code>.</p>
  
  <p>Some code I thought might be close to the true way.</p>
  
  <pre><code>const state = {
    'some_id_1': {
      type: 'radio',
      id: 'some_id_1',
      checked: true
    }, 
    'some_id_2': {
      type: 'radio',
      id: 'some_id_2',
      checked: false
    }, 
    'some_id_3': {
      type: 'checkbox',
      id: 'some_id_3',
      checked: false
    }
  };
  
  const state = Object.assign({}, state, (item) =&gt; {
    if(item.type === 'radio') {
      console.log('reset='+item);
      item.checked = false;
    }
    return item;
  });
  return state;
  </code></pre>
  
  <p>But of course this doesn't work as it's not how <code>Object.assign</code> works.</p>
  
  <p>Of course I could also loop over the object's keys, i.e. 'radio_box_1_id', ... and set anything with <code>item.type === 'radio'</code> to false, or even bring these changed values out to a separate state object and replace it using another argument of <code>Object.assign</code>. But these seem like extra processing time and not the perfect solution I'm looking for.</p>
  
  <p>Thanks</p>
  
  <p>Edit: My goal is to set the items of my state to a state of NOT checked, if they are a radio, but try not to change the others. I want to do this efficiently if it's possible. I can set the right radio afterwards to true.</p>