-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (25 loc) · 716 Bytes
/
index.js
File metadata and controls
30 lines (25 loc) · 716 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
import React from 'react';
import thunk from 'redux-thunk';
import {render} from 'react-dom';
import {Provider} from 'react-redux';
import {createStore, applyMiddleware} from 'redux';
import registerServiceWorker from './registerServiceWorker';
import {currencies} from './store/reducer';
import Router from './components/router';
import {loadState, saveState} from './store/actions';
const persistedState = loadState();
const store = createStore(
currencies,
persistedState,
applyMiddleware(thunk)
);
store.subscribe(() => {
saveState(store.getState());
});
render(
<Provider store={store}>
<Router/>
</Provider>,
document.getElementById('root')
);
registerServiceWorker();