title: Ngrx store immutable state with an array?
body: <p>I'm planning to create a large application with Angular 5. I want to use Ngrx too to store the state of my app. But there is one thing I don't understand.</p>
  
  <p>Let's say that I have an object (I don't use classes or interfaces now for simplicity), that represents my state in a <code>Store</code>:</p>
  
  <pre><code>let state = {
      x: 10,
      y: [1, 2, 3]
  };
  </code></pre>
  
  <p>In every article that I read the writers are using <code>Object.assign()</code> to create a copy of the state in a reducer. For example:</p>
  
  <pre><code>...
  case SET_X:
      return Object.assign({}, state, {x: 123});
  ...
  </code></pre>
  
  <p>But this doesn't create a deep copy of the state. So the <code>y</code> array of the new state is the same as the old one's. This is against the concept of Redux/Ngrx, I think.</p>
  
  <p>So does this mean that I have to use <code>List</code> Immutable.js or something like that for example, and every article is "wrong"? Or am I missing something? I don't think that this would be a very special case.</p>