title: Why every Redux Middleware can call next(action), wouldn't it dispatch one action multiple times?
body: <p>I was reading official <a href="https://redux.js.org/advanced/middleware#the-final-approach" rel="nofollow noreferrer">tutorials</a> about middlewares.</p>
  
  <p>I am confused about this line of middleware code: <code>next(action)</code></p>
  
  <p>From my understanding, the <code>next</code> function is actually <code>store.dispatch</code>, and every Middleware will call <code>next(action)</code>, wouldn't it dispatch that action multiple times?</p>
  
  <p>So here are two Middlewares:</p>
  
  <pre class="lang-js prettyprint-override"><code>const logger = store =&gt; next =&gt; action =&gt; {
    console.log('dispatching', action)
    let result = next(action) // I'm talking about this line
    console.log('next state', store.getState())
    return result
  }
  
  const crashReporter = store =&gt; next =&gt; action =&gt; {
    try {
      return next(action) // This line too.
    } catch (err) {
      console.error('Caught an exception!', err)
      Raven.captureException(err, {
        extra: {
          action,
          state: store.getState()
        }
      })
      throw err
    }
  }
  </code></pre>
  
  <p>Line 3 and 10 both call <code>next(action)</code>, plus I have the very first <code>store.dispatch(action)</code>, wouldn't that action be dispatched 3 times?</p>
  
  <p>Wouldn't that break the app?</p>