title: Updating an array of objects in redux
body: <p>The initial state looks like this:</p>
  
  <pre><code>const INITIAL_STATE = {
      myArray: []
  };
  </code></pre>
  
  <p>Now in my reducer, I want to append a new object to the existing array.
  I came up with something like this but it doesn't work as expected.</p>
  
  <pre><code>    case ADD_TO_ARRAY:
          return {
              ...state,
              myArray: [...state[ { action.payload.key: action.payload.value} ]]
          };
  </code></pre>
  
  <p>Note: I want to create a new object, in line, using the key and value passed in the action payload.</p>