-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathguidance.jsx
54 lines (42 loc) · 1.6 KB
/
guidance.jsx
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
import React from 'react';
import ReactDOM from 'react-dom';
import configureStore from './store/store';
import Root from './components/root';
import * as SessionUtil from './util/session_api_util';
import * as ProjectUtil from './util/project_api_util';
import * as UserUtil from './util/user_api_util';
import * as StepUtil from './util/step_api_util';
import * as CommentUtil from './util/comment_api_util';
import * as SessionActions from './actions/session_actions';
import * as ProjectActions from './actions/project_actions';
import * as UserActions from './actions/user_actions';
import * as StepActions from './actions/step_actions';
import * as CommentActions from './actions/comment_actions';
import * as Selectors from './reducers/selectors';
document.addEventListener('DOMContentLoaded', () => {
let store;
if (window.currentUser) {
const preloadedState = {
session: { currentUser: window.currentUser }
};
store = configureStore(preloadedState);
delete window.currentUser;
} else {
store = configureStore();
}
window.getState = store.getState;
window.dispatch = store.dispatch;
window.SessionUtil = SessionUtil;
window.ProjectUtil = ProjectUtil;
window.UserUtil = UserUtil;
window.StepUtil = StepUtil;
window.CommentUtil = CommentUtil;
window.SessionActions = SessionActions;
window.ProjectActions = ProjectActions;
window.UserActions = UserActions;
window.StepActions = StepActions;
window.CommentActions = CommentActions;
window.Selectors = Selectors;
const root = document.getElementById('root');
ReactDOM.render(<Root store={store} />, root);
});