<commit_before>import { createStore, applyMiddleware, combineReducers, compose } from 'redux'
import { syncHistory, routeReducer } from 'react-router-redux'
import { browserHistory } from 'react-router'
import DevTools from '../containers/DevTools.jsx'
import thunk from 'redux-thunk'
import createLogger from 'redux-logger'
import * as reducers from '../reducers'

const reducer = combineReducers(Object.assign({}, reducers, {
  routing: routeReducer
}))

let finalCreateStore = null

if(process.env.SERVER) {
  if(process.env.PROD) {
    finalCreateStore = compose(
      applyMiddleware(thunk)
    )(createStore)
  }else {
    finalCreateStore = compose(
      applyMiddleware(thunk),
      DevTools.instrument()
    )(createStore)
  }
}else {
  const reduxRouterMiddleware = syncHistory(browserHistory)
  finalCreateStore = compose(
    applyMiddleware(thunk),
    applyMiddleware(reduxRouterMiddleware),
    applyMiddleware(createLogger()),
    DevTools.instrument()
  )(createStore)
}

export default function configureStore(initialState) {
  const store = finalCreateStore(reducer, initialState)

  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('../reducers', () => {
      const nextRootReducer = require('../reducers')<commit_msg>[ FIX ] route time line works on redux-devtools<commit_after>import { createStore, applyMiddleware, combineReducers, compose } from 'redux'
import { syncHistory, routeReducer } from 'react-router-redux'
import { browserHistory } from 'react-router'
import DevTools from '../containers/DevTools.jsx'
import thunk from 'redux-thunk'
import createLogger from 'redux-logger'
import * as reducers from '../reducers'

const reducer = combineReducers(Object.assign({}, reducers, {
  routing: routeReducer
}))

let finalCreateStore = null
let reduxRouterMiddleware = null

if(process.env.SERVER) {
  if(process.env.PROD) {
    finalCreateStore = compose(
      applyMiddleware(thunk)
    )(createStore)
  }else {
    finalCreateStore = compose(
      applyMiddleware(thunk),
      DevTools.instrument()
    )(createStore)
  }
}else {
  reduxRouterMiddleware = syncHistory(browserHistory)
  finalCreateStore = compose(
    applyMiddleware(thunk),
    applyMiddleware(reduxRouterMiddleware),
    applyMiddleware(createLogger()),
    DevTools.instrument()
  )(createStore)
}

export default function configureStore(initialState) {
  const store = finalCreateStore(reducer, initialState)
  !process.env.SERVER && reduxRouterMiddleware.listenForReplays(store)

  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('../reducers', () => {
      const nextRootReducer = require('../reducers')
{'fraction_non_alphanumeric': 0.11201179071481208, 'fraction_numerical': 0.0, 'mean_word_length': 4.597938144329897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3605584', 'n_tokens_mistral': 818, 'n_tokens_neox': 805, 'n_words': 182}