-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmain.js
More file actions
36 lines (31 loc) · 970 Bytes
/
main.js
File metadata and controls
36 lines (31 loc) · 970 Bytes
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
import React from 'react';
import ReactDOM from 'react-dom';
import { composeWithDevTools } from 'redux-devtools-extension';
import { createLogger } from 'redux-logger';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import { loadState, saveState } from '../views/local-storage';
import rootReducer from '../views/reducers/index';
import Main from '../views/main.jsx';
import Main2 from '../views/main.jsx';
import Main3 from '../views/main.jsx';
import Main4 from '../views/main.jsx';
const persistedState = loadState();
const store = createStore(rootReducer,
persistedState,
composeWithDevTools(
applyMiddleware(
createLogger({ collapsed: true })
)
)
);
store.subscribe(() => {
var c = "123" + "333"
saveState(store.getState());
});
window.onload = function() {
ReactDOM.render(
<Provider store={store}>
<Main />
</Provider>, document.getElementById('app'));
};