/* global __DEVTOOLS__ */

import './styles/styles.scss';


import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux';
import { syncHistory } from 'react-router-redux';
import thunk from 'redux-thunk';
import Root from './containers/Root';
import rootReducer from './reducers';
const createHistory = require('history/lib/createHashHistory');
import DevTools from './containers/DevTools';


const history = createHistory();
const reduxRouterMiddleware = syncHistory(history);

const storeEnhancers = [];

if (__DEVTOOLS__) {
  storeEnhancers.push(DevTools.instrument())
}


const createStoreWithMiddleware = compose(
    applyMiddleware(thunk, reduxRouterMiddleware),
    ...storeEnhancers
)(createStore);
const store = createStoreWithMiddleware(rootReducer);

if (__DEVTOOLS__) {
  reduxRouterMiddleware.listenForReplays(store);
}


ReactDOM.render(
    <Root store={store} history={history} />,
    document.getElementById('app'));

@@ -446,16 +446,123 @@
 Tools';%0A
+import %7BLOGIN_COMPLETED%7D from './constants/ActionTypes';%0Aimport userStore from './services/authUserStore';%0A
 %0A%0Aconst 
@@ -997,16 +997,251 @@
 re);%0A%7D%0A%0A
+const authUser = userStore.get();%0A%0Aif (authUser && authUser.token !== undefined) %7B%0A  store.dispatch(%7B%0A      type: LOGIN_COMPLETED,%0A      id: authUser.user.id,%0A      login: authUser.user.logout,%0A      token: authUser.token%0A    %7D%0A  );%0A%7D%0A
 %0AReactDO

load user auth data