Created
June 24, 2018 07:53
-
-
Save AndrejGajdos/c7c37f74f99e0120817402c6127b8a69 to your computer and use it in GitHub Desktop.
This file is part of project https://github.com/AndrejGajdos/auth-flow-spa-node-react
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import createHistory from 'history/createBrowserHistory'; | |
import { createStore, combineReducers, applyMiddleware } from 'redux'; | |
import { ConnectedRouter, routerReducer, routerMiddleware } from 'react-router-redux'; | |
import { Provider } from 'react-redux'; | |
import createSagaMiddleware from 'redux-saga'; | |
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'; | |
import 'bootstrap'; | |
import 'bootstrap/dist/css/bootstrap.css'; | |
import 'react-tippy/dist/tippy.css'; | |
import App from 'components/App'; | |
import reducers from 'state/index'; | |
import sagas from 'sagas/index'; | |
const sagaMiddleware = createSagaMiddleware(); | |
const history = createHistory(); | |
const store = createStore( | |
combineReducers({ | |
...reducers, | |
router: routerReducer, | |
}), | |
composeWithDevTools(applyMiddleware(routerMiddleware(history), sagaMiddleware)), | |
); | |
sagaMiddleware.run(sagas); | |
ReactDOM.render( | |
<Provider store={store}> | |
<ConnectedRouter history={history}> | |
<div> | |
<App /> | |
</div> | |
</ConnectedRouter> | |
</Provider>, | |
document.getElementById('app'), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment