title: Object destructuring to update attributes
body: <p>What does syntax like the below achieve?</p>
  
  <pre><code>  return {
      ...state,
      loggedIn: true,
      user: action.payload.user,
    };
  </code></pre>
  
  <p>Assume, state's type is:</p>
  
  <pre><code>export interface State {
    loggedIn: boolean;
    user: User | null;
  }
  </code></pre>
  
  <p>Is it way to add/update attribute values in a object?</p>
  
  <p>I found the this example here: <a href="https://github.com/ngrx/platform/blob/master/example-app/app/auth/reducers/auth.ts" rel="nofollow noreferrer">https://github.com/ngrx/platform/blob/master/example-app/app/auth/reducers/auth.ts</a></p>