title: How to filter an array object in a reducer without affecting the actual state
body: <p>I'm trying to filter an object from an array (redux reducer), </p>
  
  <pre><code>const data = [
      {id: 0, name: 'Printed Men black Shirt', itemCode: 1000, price: 530, currency: '$', manufacturer: 'ColorWorld'},
      {id: 1, name: 'Denim blue white shorts', itemCode: 1001, price: 230, currency: '$', manufacturer: 'ColorWorld'},
      {id: 2, name: 'Solid Men blue pants', itemCode: 1003, price: 1530, currency: '$', manufacturer: 'Mecrono Hipli'},
      {id: 3, name: 'Checkerd Men Blue Shorts', itemCode: 1300, price: 2530, currency: '$', manufacturer: 'Mecrono Hipli Mini'},
      {id: 4, name: 'Self Designed Pant', itemCode: 1056, price: 130, currency: '$', manufacturer: 
  ];
  
  export const listProducts = (state = data, action) =&gt; {
      switch(action.type){
          case LIST_ALL_PRODUCTS: {
              return state;
          }
  
          case SEARCH_PRODUCT: {
             return state.filter((e)=&gt; e.name.includes(action.payload))
          }
  
          default: 
          return state
      }
  }
  </code></pre>
  
  <p>This reducer always updates the actual state. Why this is not making a new filtered array?</p>