text: import { createStore, applyMiddleware, compose } from 'redux'
  import { routerMiddleware } from 'react-router-redux'
  import thunk from 'redux-thunk'
  import createHistory from 'history/createBrowserHistory'
  import persistState from 'redux-localstorage'
  import rootReducer from '../reducers'
  
  export const history = createHistory()
  
  const initialState = { app: {} }
  const enhancers = [
    persistState(['app'])
  ]
  const middleware = [
    thunk,
    routerMiddleware(history)
  ]
  
  if (process.env.NODE_ENV === 'development') {
    const devToolsExtension = window.devToolsExtension
  
    if (typeof devToolsExtension === 'function') {
      enhancers.push(devToolsExtension())
    }
  }
  
  const composedEnhancers = compose(
    applyMiddleware(...middleware),
    ...enhancers
  )
  
  const store = createStore(
    rootReducer,
    initialState,
    composedEnhancers
  )
  
  export default store
  