-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
42 lines (36 loc) · 1.16 KB
/
main.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 { createDevTools } from "redux-devtools";
import LogMonitor from "redux-devtools-log-monitor";
import DockMonitor from "redux-devtools-dock-monitor";
import React from "react"; // eslint-disable-line no-unused-vars
import ReactDOM from "react-dom";
import { createStore, combineReducers } from "redux";
import { Provider } from "react-redux";
import { Router, hashHistory } from "react-router";
import { syncHistoryWithStore, routerReducer } from "react-router-redux";
import * as reducers from "./client/components/reducers";
import AppRouter from "./client/app/app.router";
const reducer = combineReducers({
...reducers,
routing: routerReducer
});
const DevTools = createDevTools(
<DockMonitor toggleVisibilityKey="ctrl-h" changePositionKey="ctrl-q">
<LogMonitor theme="tomorrow" preserveScrollTop={false} />
</DockMonitor>
);
const store = createStore(
reducer,
DevTools.instrument()
);
const history = syncHistoryWithStore(hashHistory, store);
ReactDOM.render(
<Provider store={store}>
<div>
<Router history={history}>
{AppRouter}
</Router>
<DevTools />
</div>
</Provider>,
document.getElementById("mount")
);