<commit_before>import {createStore, applyMiddleware} from 'redux';
import {composeWithDevTools} from 'redux-devtools-extension';
import reducer from 'store/rootReducer';
import error from 'store/middleware/error';
import humaniqBackendApi from 'store/middleware/humaniqBackendApi'
import butterCmsApi from 'store/middleware/butterCmsApi'

// import createLogger from 'redux-logger';

const enhancer = composeWithDevTools(
  applyMiddleware(
    humaniqBackendApi,
    butterCmsApi,
    error),
);

const store = (initialState = {}) => createStore(
  reducer,
  initialState,
  enhancer
)

if (module.hot) {
  module.hot.accept('./rootReducer', () => {
    const nextRootReducer = require('./rootReducer');
    store.replaceReducer(nextRootReducer);
  });
}

export default store;<commit_msg>fix createStore for dev<commit_after>import {createStore as reduxCreateStore, applyMiddleware} from 'redux';
import {composeWithDevTools} from 'redux-devtools-extension';
import reducer from 'store/rootReducer';
import error from 'store/middleware/error';
import humaniqBackendApi from 'store/middleware/humaniqBackendApi'
import butterCmsApi from 'store/middleware/butterCmsApi'

// import createLogger from 'redux-logger';

let store

const createStore = (initialState = {}) => {
  if (!store) {
    const enhancer = composeWithDevTools(
      applyMiddleware(humaniqBackendApi, butterCmsApi, error)
    )

    store = reduxCreateStore(
      reducer,
      initialState,
      enhancer
    )
  }

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

  return store
}

export default createStore
{'fraction_non_alphanumeric': 0.11163337250293771, 'fraction_numerical': 0.0, 'mean_word_length': 4.583606557377049, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3807519', 'n_tokens_mistral': 535, 'n_tokens_neox': 527, 'n_words': 116}