title: javascript es6 double arrow functions
body: <p>I want to better understand es6 arrow functions.</p>
  
  <p>Given the following example:</p>
  
  <pre><code>    export default function applyMiddleware(...middlewares) {
        return (createStore) =&gt; (reducer, preloadedState, enhancer) =&gt; {
          // snip actual enhancer logic
  
          return {
              ...store,
              dispatch
          }
      }
  }
  </code></pre>
  
  <p>Describing the above in words:</p>
  
  <ol>
  <li>Our exported function (applyMiddleware) takes an array parameter with spread.</li>
  <li>Then applyMiddleware returns a nameless function with a createStore parameter, which returns another nameless function this time with three parameters.</li>
  </ol>
  
  <p>So without the arrows it would look like this:</p>
  
  <pre><code>export default function applyMiddleware(...middlewares) {
    return function(createStore){
        return function(reducer,preloadedState,enhancer){
          //some logic
  
            return{...store,dispatch}
        }
      }
  }
  </code></pre>
  
  <p>My questions:</p>
  
  <ol>
  <li>Am I correct?</li>
  <li>What is the common use case/code paradigm we see here?</li>
  </ol>