import { createStore, applyMiddleware } from 'redux';
import { reduxReactRouter } from 'redux-router';
import createHistory from 'history/lib/createBrowserHistory';
import routes from '../routes';
import thunkMiddleware from 'redux-thunk';
import createLogger from 'redux-logger';
import rootReducer from '../reducers';


const createStoreWithMiddleware = applyMiddleware(
  thunkMiddleware,
  reduxReactRouter({ routes, createHistory }),
  createLogger()
)(createStore);

export default function configureStore(initialState) {
  const store = createStoreWithMiddleware(rootReducer, initialState);

  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('../reducers', () => {
      const nextRootReducer = require('../reducers');
      store.replaceReducer(nextRootReducer);
    });
  }

  return store;
}

@@ -30,16 +30,25 @@
 ddleware
+, compose
  %7D from 
@@ -56,16 +56,16 @@
 redux';%0A
-
 import %7B
@@ -101,24 +101,57 @@
 ux-router';%0A
+import thunk from 'redux-thunk';%0A
 import creat
@@ -236,51 +236,8 @@
 s';%0A
-import thunkMiddleware from 'redux-thunk';%0A
 impo
@@ -317,16 +317,20 @@
 ';%0A%0A
-%0A
 const 
-c
+finalC
 reat
@@ -339,24 +339,21 @@
 tore
-WithMiddleware =
+ = compose(%0A 
  app
@@ -369,26 +369,49 @@
 are(
-%0A  
 thunk
-Middleware
+),%0A  applyMiddleware(createLogger())
 ,%0A  
@@ -457,26 +457,8 @@
 y %7D)
-,%0A  createLogger()
 %0A)(c
@@ -542,17 +542,22 @@
 store = 
-c
+finalC
 reateSto
@@ -562,22 +562,8 @@
 tore
-WithMiddleware
 (roo

Configure store creation to incorporate ReduxRouter