title: What is the shortest way to modify immutable objects using spread and destructuring operators
body: <p>I'm looking for a pure function, to modify my immutable state object. The original state given as parameter must stay untouched. This is especially useful when working with frameworks like <a href="https://github.com/reactjs/redux" rel="noreferrer">Redux</a> and makes working with <a href="https://facebook.github.io/immutable-js/" rel="noreferrer">immutable</a> object in javascript much easier. Especially since working with the object spread operator using <a href="https://babeljs.io/" rel="noreferrer">Babel</a> is already possible.</p>
  
  <p>I did not found anything better than first copy the object, and than assign/delete the property I want like this:</p>
  
  <pre><code>function updateState(state, item) {
    newState = {...state};
    newState[item.id] = item;
    return newState;
  }
  
  function deleteProperty(state, id) {
      var newState = {...state};
      delete newState[id];
      return newState;
  }
  </code></pre>
  
  <p>I feel like it could be shorter</p>