title: Redux: "TypeError: Invalid attempt to spread non-iterable instance" when working with an id-based dictionary
body: <p>I have this reducer:</p>
  
  <pre><code>const defaultState = {}
  export default (state = defaultState, action) =&gt; {
      switch (action.type) {      
        case 'ADD_USER_MESSAGE':
          return {
             ...state,
             [action.id]:[
                 ...state[action.id],//I assume the problem is here...
                 action.message
             ]
          };
        default:
          return state;
      }
    };
  </code></pre>
  
  <p>Each key is the ID of some user. It will contain an array of messages, that came from this user.</p>
  
  <p>This is the action:</p>
  
  <pre><code> export const addUserMessage = (id,message) =&gt; ({
      type: 'ADD_USER_MESSAGE',
      id,
      message
    });
  </code></pre>
  
  <p>In the beginning the state is just an emtpy object, as you can see. I'm getting this error, when dispatching the action: </p>
  
  <blockquote>
    <p>TypeError: Invalid attempt to spread non-iterable instance</p>
  </blockquote>
  
  <p>What is the problem with my code? I must say, this whole "immutability" idea is a real pain. Isn't there some intuitive way to change the Redux state, using methos like Array.push()?</p>
  
  <p>Edit: this is how my state should look like:</p>
  
  <pre><code>{
        1:[...messages],
        45: [...messages]
    }
  </code></pre>