-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.jsx
78 lines (67 loc) · 1.97 KB
/
index.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import React from "react"
import ReactDOM from "react-dom";
import MainComponent from "./components/containers/MainComponent.jsx";
import "regenerator-runtime/runtime";
import {Provider} from "react-redux";
import {createStore, applyMiddleware} from "redux";
import mainReducer from "./components/reducers/MainReducer";
import rootSaga from "./components/sagas"
import createSagaMiddleware from 'redux-saga';
require('../scss/app.scss');
let initialDataState = {
uiState: 'bizSearch', // bizSearch or bizInfo
infoLoading: false,
autoSuggests: {
categories: [
{name: '---'},
{name: '---'},
{name: '---'},
{name: '---'},
{name: '---'},
],
businesses: [
{name: '---'},
{name: '---'},
{name: '---'},
{name: '---'},
{name: '---'},
],
terms: [
{name: '---'},
{name: '---'},
{name: '---'},
{name: '---'},
{name: '---'},
],
},
businessList: [ // 5 business listings
{name: '---'},
{name: '---'},
{name: '---'},
{name: '---'},
{name: '---'},
],
businessInfo: {}, // info for selected business
};
const searchEndpoint = "https://simplserve.com/yelpsearch";
const suggestEndpoint = "https://simplserve.com/yelpsuggest";
const bizEndpoint = "https://simplserve.com/yelpbizinfo";
export {initialDataState,searchEndpoint,bizEndpoint, suggestEndpoint}
/*
const reducers = combineReducers({
cachedData: cachedDataReducer,
});
*/
const sagaMiddleware = createSagaMiddleware();
const store = createStore(
mainReducer,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
applyMiddleware(sagaMiddleware)
);
sagaMiddleware.run(rootSaga);
ReactDOM.render(
<Provider store={store}>
<MainComponent/>
</Provider>,
document.getElementById('main-container'),
);