<commit_before>import { createStore, applyMiddleware, compose } from 'redux';
import persistState from 'redux-localstorage';
import { apiMiddleware } from 'redux-api-middleware';
import thunk from 'redux-thunk';
import apiMiddlewareHook from 'reducers/middlewares/apiMiddlewareHook';
import camelizeState from 'reducers/middlewares/camelizeState';
import { hashHistory } from 'react-router';
import { syncHistory } from 'react-router-redux';
import rootReducer from '../reducers';

const router = syncHistory(hashHistory);

const middlewares = [
  thunk, router, apiMiddlewareHook, apiMiddleware, camelizeState
];

if (process.env.NODE_ENV === 'developement') {
  const createLogger = require('redux-logger');
  const logger = createLogger();
  middlewares.push(logger);
}

const enhancer = compose(
  applyMiddleware(...middlewares),
  persistState(['auth'], { key: `douban_sauce_${process.env.NODE_ENV || 'development'}.auth` })
);

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

  if (process.env.NODE_ENV === 'development') {
    router.listenForReplays(store);

    if (module.hot) {
      module.hot.accept('../reducers', () =>
        store.replaceReducer(require('../reducers'))<commit_msg>fix log disappear bug<commit_after>import { createStore, applyMiddleware, compose } from 'redux';
import persistState from 'redux-localstorage';
import { apiMiddleware } from 'redux-api-middleware';
import thunk from 'redux-thunk';
import apiMiddlewareHook from 'reducers/middlewares/apiMiddlewareHook';
import camelizeState from 'reducers/middlewares/camelizeState';
import { hashHistory } from 'react-router';
import { syncHistory } from 'react-router-redux';
import rootReducer from '../reducers';

const router = syncHistory(hashHistory);

const middlewares = [
  thunk, router, apiMiddlewareHook, apiMiddleware, camelizeState
];

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

const enhancer = compose(
  applyMiddleware(...middlewares),
  persistState(['auth'], { key: `douban_sauce_${process.env.NODE_ENV || 'development'}.auth` })
);

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

  if (process.env.NODE_ENV === 'development') {
    router.listenForReplays(store);

    if (module.hot) {
      module.hot.accept('../reducers', () =>
        store.replaceReducer(require('../reducers'))
{'fraction_non_alphanumeric': 0.136310223266745, 'fraction_numerical': 0.0, 'mean_word_length': 5.5487179487179485, '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': '7361622', 'n_tokens_mistral': 790, 'n_tokens_neox': 760, 'n_words': 168}