<commit_before>import { createStore, applyMiddleware } from "redux"
import thunk from "redux-thunk"
import rootReducer from "../reducers"
import { routerMiddleware } from "react-router-redux"
import {
  tokenStorageMiddleware,
  userStorageMiddleware,
} from "middlewares/storage"
import { dsctypes } from "../constants"
import history from "utils/routerHistory"

const options = {
  save: dsctypes.LOGIN_SUCCESS,
  remove: dsctypes.LOGOUT_SUCCESS,
}
const enhancer = applyMiddleware(
  routerMiddleware(history),
  thunk,
  tokenStorageMiddleware(options),
  userStorageMiddleware(options),
)

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

  if (module.hot) {
    module.hot.accept("../reducers", () =>
      store.replaceReducer(require("../reducers").default),
    )
  }
  return store
}<commit_msg>Added instance of middleware to persist state of shopping cart<commit_after>import { createStore, applyMiddleware } from "redux"
import thunk from "redux-thunk"
import rootReducer from "../reducers"
import { routerMiddleware } from "react-router-redux"
import manageStateStorage from "middlewares/storage"
import { dsctypes } from "../constants"
import history from "utils/routerHistory"

const authArg = {
  save_action: dsctypes.LOGIN_SUCCESS,
  remove_action: dsctypes.LOGOUT_SUCCESS,
  key: "auth",
  namespace: "auth",
}
const cartArg = {
  save_action: dsctypes.ADD_TO_CART,
  remove_action: dsctypes.REMOVE_FROM_CART,
  key: "cart",
  namespace: "shoppingCart",
}
const enhancer = applyMiddleware(
  routerMiddleware(history),
  thunk,
  manageStateStorage(authArg),
  manageStateStorage(cartArg),
)

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

  if (module.hot) {
    module.hot.accept("../reducers", () =>
      store.replaceReducer(require("../reducers").default),
    )
  }
  return store
}
{'fraction_non_alphanumeric': 0.11406649616368286, 'fraction_numerical': 0.0, 'mean_word_length': 5.1125, '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': '7297346', 'n_tokens_mistral': 608, 'n_tokens_neox': 610, 'n_words': 138}