Ngrx store immutable state with an array?
问题 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. Let's say that I have an object (I don't use classes or interfaces now for simplicity), that represents my state in a Store : let state = { x: 10, y: [1, 2, 3] }; In every article that I read the writers are using Object.assign() to create a copy of the state in a reducer. For example: ... case SET_X: return Object.assign({}, state, {x: 123