title: When to use dispatch vs return in actions?
body: <p>I am a bit confused when it comes to dispatching actions. In the actions sometimes I see this:</p>
  
  <pre><code>export const getConfig = () =&gt; dispatch =&gt; {
      const res = await axios.get('/api/users');
      dispatch({
          type : TYPES.GET_CONFIG,
          payload : res.data
      });
  }
  </code></pre>
  
  <p>and sometimes I see:</p>
  
  <pre><code>export const getConfig = () =&gt; {
      const res = await axios.get('/api/users');
  
      return{
          type : TYPES.GET_CONFIG,
          payload : res.data
      };
  }
  </code></pre>
  
  <p>Are they both same? or they have their own use cases? When to use what?</p>
  
  <p>Thanks.</p>