title: Update nested state structure in Angular / ngrx reducer
body: <p>I have a nested state structure that represents a time entry table. I store an array of <code>TimeEntryRow</code> objects, where each row object has it's own array of <code>TimeEntry</code> objects. Note that the objects store an index that represents their position in the table.</p>
  
  <pre><code>export interface TimeState {
      timeEntryRows?: TimeEntryRow[];
      ...
  }
  
  export class TimeEntryRow {
      rowIndex: number;
      timeEntries: TimeEntry[];
      ...
  }
  
  export class TimeEntry {
      cellIndex: number;
      hours: number;
      ...
  }
  </code></pre>
  
  <p>I have a reducer that is attempting to update the hours of a single cell in the table, but I'm having some issues getting it to work. With the following action case, the state remains unchanged:</p>
  
  <pre><code>case timeEntryActions.HOURS_CHANGED_ACTION: {
      return {
          ...state,
          timeEntryRows: {
              ...state.timeEntryRows.map(row =&gt; {
                  return row.rowIndex !== action.payload.rowIndex ? row : {
                      ...row,
                      timeEntries: {
                          ...row.timeEntries.map(te =&gt; {
                              return te.cellIndex !== action.payload.cellIndex ? te : {
                                  ...te,
                                  hours: action.payload.hours
                              }
                          })
                      }
                  }
              })
          }
      }
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>