text: // @flow
  import { createStore, applyMiddleware } from 'redux';
  import thunk from 'redux-thunk';
  import { createHashHistory } from 'history';
  import { routerMiddleware } from 'connected-react-router';
  import createRootReducer from '../reducers';
  import type { fileStateType } from '../reducers/types';
  
  const history = createHashHistory();
  const rootReducer = createRootReducer(history);
  const router = routerMiddleware(history);
  const enhancer = applyMiddleware(thunk, router);
  
  function configureStore(initialState?: fileStateType) {
    return createStore<*, fileStateType, *>(
      rootReducer,
      initialState,
      enhancer
    );
  }
  
  export default { configureStore, history };
  