title: updating immutable object array, redux
body: <p>I'm getting error 'Invariant Violation: Tried to get frame for out of range index NaN' due to incorrect assigning/ or empty array being sent from the reducer.
  I'm trying to update 3 fields, state.items[index].status, state.items[index].statusUpdatedOn and state.items[index].statusUpdatedBy.</p>
  
  <p>Since its nested, i'm trying update as below in my reducer.
  Looks like something wrong with the code, which i'm unable to find out:</p>
  
  <pre><code>case ActionTypes.UPDATE_ITEM_STATUS:
    var index = state.items.findIndex((item) =&gt; item.id === action.payload.id)
    return { ...state,
      items: {
        ...state.items,
        [index]:{
          ...state.items[index],
          status: action.payload.newStatus,
          statusUpdatedOn: action.payload.statusUpdatedOn,
          statusUpdatedBy: action.payload.statusUpdatedBy
        }
      },
      isLoading: false,
      errMess: null
    }
    break;
  </code></pre>
  
  <p>while my state object is having elements:</p>
  
  <pre><code>  items: [],
    errMess: '',
    isLoading: false,
  </code></pre>
  
  <p>Please help me correcting the code</p>