import {createHistory} from 'history';
import {createStore, applyMiddleware, compose, combineReducers} from 'redux';
import thunkMiddleware from 'redux-thunk';
import {reduxReactRouter} from 'redux-router';

import routes from './routes';
import reducers from './reducers';

export default function createAppStore(initialState) {
  let finalCreateStore = createStore;

  if (process.env.NODE_ENV === 'development') {
    const logger = require('redux-logger');

    finalCreateStore = compose(
      applyMiddleware(logger()),
    )(finalCreateStore);
  }

  finalCreateStore = compose(
    applyMiddleware(
      thunkMiddleware
    ),
    reduxReactRouter({
      routes,
      createHistory,
    }),
    window.devToolsExtension ? window.devToolsExtension() : cs => cs
  )(finalCreateStore);

  return finalCreateStore(combineReducers(reducers), initialState);
}

@@ -199,16 +199,51 @@
 router';
+%0Aimport logger from 'redux-logger';
 %0A%0Aimport
@@ -407,76 +407,58 @@
 if (
-process.env.NODE_ENV === 'development') %7B%0A    const logger = require
+window.localStorage && window.localStorage.getItem
 ('re
@@ -469,18 +469,19 @@
 logger')
-;%0A
+) %7B
 %0A    fin

Allow to use logger on production by adding `redux-logger` key in localStorage