-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
63 lines (58 loc) · 1.72 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import {createStore, applyMiddleware, compose} from 'redux';
import rootReducer from './reducers';
import {fetchTaskManagers, fetchJobs, fetchClusterInfo} from './actions';
import thunkMiddleware from 'redux-thunk'
import { createLogger } from 'redux-logger'
import { Provider } from 'react-redux'
import {library} from '@fortawesome/fontawesome-svg-core'
import {
faTachometerAlt,
faTasks,
faCheckCircle,
faSitemap,
faServer,
faUpload,
faSignInAlt,
faMemory,
faHandshake,
faBatteryThreeQuarters
} from '@fortawesome/free-solid-svg-icons'
library.add(faTachometerAlt)
library.add(faTasks)
library.add(faCheckCircle)
library.add(faSitemap)
library.add(faServer)
library.add(faUpload)
library.add(faSignInAlt)
library.add(faMemory)
library.add(faHandshake)
library.add(faBatteryThreeQuarters)
const loggerMiddleware = createLogger()
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
rootReducer,
composeEnhancers(applyMiddleware(
thunkMiddleware, // lets us dispatch() functions
loggerMiddleware // neat middleware that logs actions
))
)
// Dispatch actions
setInterval(() => {
store.dispatch(fetchJobs())
store.dispatch(fetchTaskManagers())
store.dispatch(fetchClusterInfo())
}, 5000)
ReactDOM.render(
<Provider store={store}>
<App/>
</Provider>,
document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/CRA-PWA
serviceWorker.unregister();