title: What does "dispatch()" mean/do, and why is it used when we have .then() and .catch()
body: <p>I am new to ES6 and advanced javascript. I have seen examples of code using the axios http client like this:</p>
  
  <pre><code>axios.xxx(...).then((res) =&gt; dispatch(success(res)) , (err)=&gt; dispatch(error(err)))
  </code></pre>
  
  <p>whereas I am doing:</p>
  
  <pre><code>axios.xxx(...).then(function(res){...}).catch(function(err){...});
  </code></pre>
  
  <p>I tried to look up dispatch on MDN but only found DispatchEvent... which is not the same? I ask because although my code works, I am finding http error codes like 403 etc from my api are handled as errors by axios, while i would prefer to handle them myself in the app. (Update: when I added the dispatch tag to this question, I saw a brief summary of the meaning but I am still confused).</p>
  
  <p><strong>What is the reason or advantage for using dispatch? Is "dispatch()" part of axios, or ES6, or nodejs?</strong> thx.</p>