title: Redux : update an item in an array of objects
body: <p>In my reducer called 'reducer_product_list', I have this array :</p>
  
  <pre><code>let initialState = [
      {name: 'Article 1', price: 5, quantity: 10},
      {name: 'Article 2', price: 15, quantity: 8},
      {name: 'Article 3', price: 7, quantity: 15},
      {name: 'Article 4', price: 9, quantity: 5},
      {name: 'Article 5', price: 11, quantity: 100},
      {name: 'Article 6', price: 23, quantity: 20},
    ]
  </code></pre>
  
  <p>When I get the action 'ADD_TO_CART', I want to decrease the quantity of the selected object. The payload is one of those objects.</p>
  
  <p>I typed the code above :</p>
  
  <pre><code>export default (state = initialState, action) =&gt; {
    switch (action.type) {
      case 'ADD_TO_CART':
        initialState.map((product, i) =&gt; {
          if (product.name === action.payload.name) {
            initialState[i].quantity -= 1
            return state;
          }
        });
      default: return state
    }
  }
  </code></pre>
  
  <p>If I console.log my initialState, the quantity is decreasing, but in my container that renders the view, the quantity stays the same.</p>
  
  <p>Thank you for your help.</p>