fixed showpage SSR to use proper Saga and Action

This commit is contained in:
bill bittner 2018-04-02 11:30:24 -07:00
parent 3d56655efe
commit da6fe2dc1d
2 changed files with 4207 additions and 6 deletions

4204
index.js

File diff suppressed because one or more lines are too long

View file

@ -16,11 +16,7 @@ import { Reducers, GAListener, App, Sagas, Actions } from 'spee.ch-components';
*/ */
import Helmet from 'react-helmet'; import Helmet from 'react-helmet';
// configure the reducers by passing initial state configs
const siteConfig = require('siteConfig.js'); const siteConfig = require('siteConfig.js');
const MyReducers = Reducers(siteConfig);
const MyApp = App(siteConfig);
const MyGAListener = GAListener(siteConfig);
const returnSagaWithParams = (saga, params) => { const returnSagaWithParams = (saga, params) => {
return function * () { return function * () {
@ -31,6 +27,11 @@ const returnSagaWithParams = (saga, params) => {
module.exports = (req, res) => { module.exports = (req, res) => {
let context = {}; let context = {};
// configure the reducers by passing initial state configs
const MyReducers = Reducers(siteConfig);
const MyApp = App(siteConfig);
const MyGAListener = GAListener(siteConfig);
// create and apply middleware // create and apply middleware
const sagaMiddleware = createSagaMiddleware(); const sagaMiddleware = createSagaMiddleware();
const middleware = applyMiddleware(sagaMiddleware); const middleware = applyMiddleware(sagaMiddleware);