content: import React from 'react';
  import ReactDOM from 'react-dom';
  import { Provider } from 'react-redux';
  import { createStore, applyMiddleware } from 'redux';
  import  {Router, browserHistory } from 'react-router';
  import rootReducer from './reducers';
  import routes from './routes';
  import promise from 'redux-promise';
  import { loadState, saveState } from './utils/localStorage';
  
  const persistedState = loadState();
  const store = createStore(rootReducer, persistedState, applyMiddleware(promise));
  
  store.subscribe(() => {
    saveState(store.getState());
  });
  
  // const createStoreWithMiddleware = applyMiddleware(
  //   promise
  // )(createStore);
  
  ReactDOM.render(
    <Provider store={store}>
      <Router history={browserHistory} routes={routes} />
    </Provider>
    , document.querySelector('.container'));
  