updated client.js to not be a constructor

This commit is contained in:
bill bittner 2018-03-16 14:09:56 -07:00
parent aa3c96b8d4
commit 402724e513

View file

@ -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;