-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.js
42 lines (38 loc) · 1 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
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import Home from './containers/home/Home';
import styles from './assets/styles/general.scss';
import {
applyMiddleware,
createStore as createReduxStore,
compose
} from "redux";
import createSagaMiddleware, { END } from "redux-saga";
import { Provider } from 'react-redux';
import rootReducer from './reducers/main';
import rootSaga from './sagas/rootSaga';
const composeEnhancers =
(
typeof window === "object" &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) ||
compose;
const sagaMiddleware = createSagaMiddleware();
const store = createReduxStore(
rootReducer,
composeEnhancers(applyMiddleware(sagaMiddleware))
);
store.runSaga = sagaMiddleware.run(rootSaga);
store.close = () => store.dispatch(END);
class AppToLoad extends Component {
render() {
return (
<Provider store={store}>
<Home />
</Provider>
);
}
}
ReactDOM.render(
<AppToLoad/>,
document.getElementById('app')
);