-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
35 lines (28 loc) · 816 Bytes
/
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
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
import reducers from './reducers';
import * as Actions from './actions'
import { loadState, saveState } from './localStorage'
function configureStore(){
return createStore(
reducers,
applyMiddleware(thunk)
)}
const store = configureStore()
// const store = createStore(reducers,
// applyMiddleware(thunk)
// );
store.subscribe(() => {
saveState(store.getState())
});
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>, document.getElementById('root'));
registerServiceWorker();