title: Reducer updating state for an array
body: <p>I am currently updating multiple item quantities and returning back an array of the updated data. I needed to update the current state with the updated values in my reducer. The example below in <strong>UPDATE_QUANTITY</strong> just returns a object and updates the current state. How would I change that if I had an array instead of an object to update the state.</p>
  <p>Code:</p>
  <pre><code>const initialState = {
      listitem: []
  }
  
  export default function(state = initialState, action) {
      switch (action.type) {
          case FETCH_ALLITEMS:
              return { ...state, listitem: action.payload.data.itemsList }
          case UPDATE_QUANTITY:  
              return { ...state,
                      listitem: state.listitem.map(
                      (content, i) =&gt; content.itemId === action.payload.data.itemId ? {...content, quantity_printed : action.payload.data.quantity_printed } : content) };
          default: 
              return state;
      }
  }
  </code></pre>