title: Angular: mutating NGXS selector data is modifying state without an Action
body: <p>I am using NGXS as my state management library. I have a users state and a selector to get list of users. I also have a component where I want to update user's name. The way I want to do this is to copy the users list that I get from the selector observable and use ngModel with inputs.</p>
  <p>Here is an <a href="https://stackblitz.com/edit/angular-t33jcn?file=src%2Fapp%2Fapp.component.html" rel="nofollow noreferrer">example of what I am trying to achieve</a>.</p>
  <p>And a snipped of my state selector</p>
  <pre><code>@Selector()
  static getAll(state: User[]) {
     return [...state];
  }
  </code></pre>
  <p>The problem is modifying the data received form the selector is modifying the actual state even without dispatching an Action. I understand its because I am mutating the objects that I get from the state directly but aren't selectors supposed to be readonly?</p>
  <p>So the questions I have are</p>
  <ol>
  <li>I thought <strong>Selectors</strong> are supposed to be read only and not modify the state in any way. Are they not?</li>
  <li>Even changing the selector to <code>return state.map(user=&gt;Object.assign({}, user))</code> doesnt work. Is is the correct way to define a Selector?</li>
  <li>Or am I missing something entirely on how to use Selectors?</li>
  </ol>