title: React merge immutable array of objects using React Immutability helpers or Immutable js
body: <p>I am trying to merge an immutable array of objects using Reacts Immutability helpers or Immutable js which ever one. I am trying to create a list of only records where the names have changed. I am trying to avoid creating duplicates in the list if the name has been changed multiple times before submission which lead me to believe a merge was the path I needed to take. An example of what I am trying to achieve is below.</p>
  
  <pre><code> var objArray = [{id:4, name:'bar'}, {id:10, name:'test'}];
   var newObj = {id:4, name:'foo'};
  
   var updatedEntries = update(this.state.nameChanges, {$merge: {newObj});
  </code></pre>
  
  <p>The Result I am looking for is:</p>
  
  <pre><code> objArray = [{id:4, name:'foo'}, {id:10, name:'test'}]
  </code></pre>
  
  <p>The Result I seem to be getting is:</p>
  
  <pre><code> objArray = [{id:4, name:'foo'}]
  </code></pre>
  
  <p>I have tried using Facebook React immutability helpers but cannot seem to get the result I need. I seem to be having a little trouble trying wrapping my head around what the merge function is actually doing. Any help is appreciated.</p>
  
  <p>Thanks</p>