title: With applyMiddleware, dispatch not working
body: <p>Hello I'm new in redux and I didn't see the problem, I look in other stackoverflow, with similar questions but didn't find mine.
  The problem is that dispatch is not working.</p>
  
  <p>src/redux/index.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export default combineReducers({
      page: pageReducer,
      fetch: fetchReducer
  })</code></pre>
  </div>
  </div>
  </p>
  
  <p>src/index.js
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import allReducer from './reducers'
  import { pageMd1 } from './reducers/middleware/page'
  import { createStore, applyMiddleware } from 'redux'
  import thunk from 'redux-thunk'
  import { Provider } from 'react-redux'
  
  const store = createStore(
      allReducer,
      applyMiddleware(thunk)
  )
  
  ReactDOM.render(
      &lt;Provider store={store}&gt;
          &lt;App /&gt;
      &lt;/Provider&gt;, 
      document.getElementById('root'));</code></pre>
  </div>
  </div>
  </p>
  
  <p>src/redux/actions</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export const PREVIOUS_PAGE = 'PREVIOUS_PAGE'
  
  export const previous_page = (max) =&gt; {
      return {
          type: PREVIOUS_PAGE,
          payload: max
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>src/redux/middleware</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { PREVIOUS_PAGE, previous_page } from '../actions'
  
  export const update_page = ({dispatch}) =&gt; next =&gt; action =&gt; {
      next(action)
    
      if (action.type === PREVIOUS_PAGE) {
        dispatch(previous_page({max: action.payload}))
      }
    }
  
    export const pageMd1 = [ update_page ]</code></pre>
  </div>
  </div>
  </p>
  
  <p>src/redux/reducer</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { NEXT_PAGE, PREVIOUS_PAGE } from './actions'
  
  export default (state = 1, action) =&gt; {
      console.log('reducer')
      switch (action.type) {
          case NEXT_PAGE:
              return state + 1
          case PREVIOUS_PAGE:
              return state - 1
          default:
              return state
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>src/Home</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;ChangePage max={this.state.max_pages} {...{prevPage, nextPage}} /&gt;
  
  const mapStateToProps = state =&gt; ({
    page: state.page
  })
  
  const mapDispatchToProps = (dispatch) =&gt; ({
    prevPage: () =&gt; dispatch(previous_page),
    nextPage: () =&gt; dispatch(next_page),
  })
  
  export default connect(mapStateToProps, mapDispatchToProps)(Home)</code></pre>
  </div>
  </div>
  </p>
  
  <p>src/ChangePage</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;button className='SelectionOff' id='decrement' onClick={() =&gt; this.props.prevPage(max_page) }&gt;Previous&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Hope is clear... The problem is that dispatch is not working</p>