title: Redux - Define new state in reducer switch statement with new variable each time?
body: <p>My reducer looks like this:</p>
  
  <pre><code>switch (action.type) {
        case "UPDATE_CURRENT_USER":
          let newState = {...state, ...action.payload };
          return newState;
        case "GET_CURRENT_USER":
          return state;
        case "UPDATE_USERNAME":
          newState = {...state, name: action.payload.name};
          return state;
    }
  </code></pre>
  
  <p>Now, the second time I am using <code>newState</code> I am not defining it again. I am simply using the variable I have defined above. Is this ok?
  I wanted to define it anew, but got an error. But I am not sure whether this way will still give me the correct result - although everything seems to be working fine?</p>