title: Configure devToolsExtension and applyMiddleware() inside the React-Redux Store
body: <p>I am unable to figure out the exact way to use devToolsExtension and middleware at the same time in the redux store.</p>
  
  <p>Below is my code for the redux store.    </p>
  
  <pre><code>import {createStore, combineReducers, applyMiddleware} from 'redux';
  import thunk from 'redux-thunk';
  import counterReducer from './../reducers/counterReducer';
  
  const reducers = combineReducers({
      counter: counterReducer
  });
  const store = createStore(
      reducers, 
      {counter: {count:0} },
      // window.devToolsExtension &amp;&amp; window.devToolsExtension(), 
      applyMiddleware(thunk)
  );
  
  export default store;
  </code></pre>
  
  <p>As createStore() takes 3 arguments.
  Before applying middleware thunk I was using it as the below code which works fine for me.</p>
  
  <pre><code>const store = createStore(
      reducers, 
      {counter: {count:0} },
      window.devToolsExtension &amp;&amp; window.devToolsExtension()
  );
  </code></pre>
  
  <p>Now, I need to use devToolsExtension as well as apply the middleware at the same time.</p>
  
  <p>I tried to put the devToolsExtension and applyMiddleware inside the array so that it acts as a third argument, but this won't work.</p>
  
  <pre><code>const store = createStore(
      reducers, 
      {counter: {count:0} },
      [window.devToolsExtension &amp;&amp; window.devToolsExtension(), 
      applyMiddleware(thunk)]
  );
  </code></pre>
  
  <p>Now the situation is that I need to either use devToolsExtension as a third argument or applyMiddleware() as a third argument.</p>
  
  <p>But I want to use both at the same time.
  How can I achieve this?</p>