-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
45 lines (30 loc) · 910 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
36
37
38
39
40
41
42
43
44
45
import React from 'react';
import { render } from 'react-dom';
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import employees from './employees.json';
import markers from './markers.json';
// Styles
import 'normalize.css';
import './index.scss'
// Components //
import App from './components/App/App';
// Reducers
import reducer from './reducers';
// Middlewares
import thunk from 'redux-thunk';
// Actions
import { addEmployee, sortByName } from './actions/employee';
import { setMarkers } from './actions/markers';
const store = createStore(reducer, applyMiddleware(thunk));
employees.forEach((employee) => {
store.dispatch(addEmployee(employee, employee.name[0].toUpperCase()));
});
store.dispatch(setMarkers(markers));
store.dispatch(sortByName());
render(
<Provider store={store}>
<App />
</Provider>,
document.querySelector('#root')
);