forked from johnbrowe/barnanavn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
24 lines (22 loc) · 799 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
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom'
import App from './App';
import { Provider } from 'react-redux';
import registerServiceWorker from './registerServiceWorker';
import store from './store.js';
// Add all changes to localstorage
store.subscribe(() => {
let state = store.getState();
localStorage.setItem('acceptedNames', JSON.stringify(state.names.accepted));
localStorage.setItem('rejectedNames', JSON.stringify(state.names.rejected));
localStorage.setItem('gender', JSON.stringify(state.gender.selected));
});
ReactDOM.render(
<BrowserRouter>
<Provider store={store}>
<App />
</Provider>
</BrowserRouter>,
document.getElementById('root'));
registerServiceWorker();