-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.js
48 lines (39 loc) · 1.19 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import 'babel-polyfill';
import 'offline-js';
import 'sanitize.css/sanitize.css';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/css/bootstrap-theme.css';
import reducer from './reducers';
import sagas from './sagas';
import Routes from './routes';
import React from 'react';
import { applyMiddleware, createStore } from 'redux';
import createSagaMiddleware from 'redux-saga';
import ReactDOM from 'react-dom';
import { applyRouterMiddleware, browserHistory } from 'react-router';
import { useScroll } from 'react-router-scroll';
import { syncHistoryWithStore} from 'react-router-redux';
import { Provider } from 'react-redux'
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
const sagaMiddleware = createSagaMiddleware();
const store = createStore(
reducer,
applyMiddleware(sagaMiddleware),
);
// Begin our Index Saga
sagaMiddleware.run(sagas);
// sync history
const history = syncHistoryWithStore(browserHistory, store);
const routerProps = {
history,
render: applyRouterMiddleware(useScroll()),
store,
sagas,
};
ReactDOM.render(
<Provider store={store}>
<Routes {...routerProps} />
</Provider>,
document.getElementById('root')
);