title: What are the advantages of putting data inside a "payload" key in a Redux action?
body: <p>I haven't found a good answer to this anywhere, and it seems like a pointless convention. In lots of tutorials and documentation, Redux actions are defined like this:</p>
  
  <pre><code>{
    type: "ACTION_NAME",
    payload: {
      foo: 123,
      bar: 456,
    }
  }
  </code></pre>
  
  <p>What's the point of the <code>payload</code> object? Why not just write this:</p>
  
  <pre><code>{
    type: "ACTION_NAME",
    foo: 123,
    bar: 456,
  }
  </code></pre>
  
  <p>I'm using Flow, and I like defining all of my action types as a union, without nested payloads:</p>
  
  <pre><code>type Action = {
    type: 'ACTION_NAME',
    foo: number,
    bar: number,
  } | {
    type: 'ANOTHER_ACTION',
    someData: string,
  } | {
    type: 'ONE_MORE_ACTION',      
    moreData: boolean,
  }
  </code></pre>
  
  <p>I don't have to type <code>payload</code> so many times, and I get autocompletion and type checking for all of my actions, so I'm not sure what I'm missing.</p>
  
  <p>Am I missing out on some benefits by not putting all of my data inside a <code>payload</code> object?</p>