
import { createStore, applyMiddleware, compose } from 'redux'

import { logger } from '../middleware'
import rootReducer from '../reducers'

const enhancer = compose(
  applyMiddleware(logger),
  window.devToolsExtension && window.devToolsExtension()
)

export default function configure(initialState) {

  const store = createStore(rootReducer, initialState, enhancer);

  if (module.hot) {
    module.hot.accept('../reducers', () => {
      const nextReducer = require('../reducers').default
      store.replaceReducer(nextReducer)
    })
  }

  return store
}


import { createStore, applyMiddleware } from 'redux'

import { logger } from '../middleware'
import rootReducer from '../reducers'

export default function configure(initialState) {
  const create = window.devToolsExtension
    ? window.devToolsExtension()(createStore)
    : createStore

  const createStoreWithMiddleware = applyMiddleware(
    logger
  )(create)

  const store = createStoreWithMiddleware(rootReducer, initialState)

  if (module.hot) {
    module.hot.accept('../reducers', () => {
      const nextReducer = require('../reducers')
      store.replaceReducer(nextReducer)
    })
  }

  return store
}

Revert "hmr for store and reducer"
Revert "hmr for store and reducer"

This reverts commit 4483c3ccabccf532431bee84d298fee633a3358f.
