Speech as a package #416

Merged
bones7242 merged 89 commits from speech-as-a-package into master 2018-04-18 21:47:34 +02:00
3 changed files with 27 additions and 23 deletions
Showing only changes of commit 8ef29f2d68 - Show all commits

File diff suppressed because one or more lines are too long

View file

@ -20,19 +20,20 @@ module.exports = (req, res) => {
let context = {};
// customize the reducer by passing in intial state configs
const CustomizedReducers = Reducers(siteConfig);
const CustomizedApp = App(siteConfig);
const MyReducers = Reducers(siteConfig);
const MyApp = App(siteConfig);
const MyGAListener = GAListener(siteConfig);
// create a new Redux store instance
const store = createStore(CustomizedReducers);
const store = createStore(MyReducers);
// render component to a string
const html = renderToString(
<Provider store={store}>
<StaticRouter location={req.url} context={context}>
<GAListener>
<CustomizedApp />
</GAListener>
<MyGAListener>
<MyApp />
</MyGAListener>
</StaticRouter>
</Provider>
);

View file

@ -18,8 +18,9 @@ import Helmet from 'react-helmet';
// configure the reducers by passing initial state configs
const siteConfig = require('siteConfig.js');
const CustomizedReducers = Reducers(siteConfig);
const CustomizedApp = App(siteConfig);
const MyReducers = Reducers(siteConfig);
const MyApp = App(siteConfig);
const MyGAListener = GAListener(siteConfig);
const returnSagaWithParams = (saga, params) => {
return function * () {
@ -35,7 +36,7 @@ module.exports = (req, res) => {
const middleware = applyMiddleware(sagaMiddleware);
// create a new Redux store instance
const store = createStore(CustomizedReducers, middleware);
const store = createStore(MyReducers, middleware);
// create saga
const action = Actions.onHandleShowPageUri(req.params);
@ -50,9 +51,9 @@ module.exports = (req, res) => {
const html = renderToString(
<Provider store={store}>
<StaticRouter location={req.url} context={context}>
<GAListener>
<CustomizedApp />
</GAListener>
<MyGAListener>
<MyApp />
</MyGAListener>
</StaticRouter>
</Provider>
);