updated client.js to not be a constructor
This commit is contained in:
parent
aa3c96b8d4
commit
402724e513
1 changed files with 20 additions and 24 deletions
|
@ -21,20 +21,19 @@ const sagaMiddleware = createSagaMiddleware();
|
||||||
const middleware = applyMiddleware(sagaMiddleware);
|
const middleware = applyMiddleware(sagaMiddleware);
|
||||||
const reduxMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__ ? compose(middleware, window.__REDUX_DEVTOOLS_EXTENSION__()) : middleware;
|
const reduxMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__ ? compose(middleware, window.__REDUX_DEVTOOLS_EXTENSION__()) : middleware;
|
||||||
|
|
||||||
const SpeechClient = () => {
|
// create teh store
|
||||||
// create teh store
|
let store;
|
||||||
let store;
|
if (preloadedState) {
|
||||||
if (preloadedState) {
|
|
||||||
store = createStore(Reducer, preloadedState, reduxMiddleware);
|
store = createStore(Reducer, preloadedState, reduxMiddleware);
|
||||||
} else {
|
} else {
|
||||||
store = createStore(Reducer, reduxMiddleware);
|
store = createStore(Reducer, reduxMiddleware);
|
||||||
}
|
}
|
||||||
|
|
||||||
// run the saga middlweare
|
// run the saga middlweare
|
||||||
sagaMiddleware.run(rootSaga);
|
sagaMiddleware.run(rootSaga);
|
||||||
|
|
||||||
// render the app
|
// render the app
|
||||||
hydrate(
|
hydrate(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<GAListener>
|
<GAListener>
|
||||||
|
@ -43,7 +42,4 @@ const SpeechClient = () => {
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</Provider>,
|
</Provider>,
|
||||||
document.getElementById('react-app')
|
document.getElementById('react-app')
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = SpeechClient;
|
|
||||||
|
|
Loading…
Reference in a new issue