Add new rx saga

This commit is contained in:
Berkeley Martinez
2016-04-24 21:54:48 -07:00
parent 96f4f3413a
commit d511be3332
24 changed files with 820 additions and 531 deletions

View File

@@ -55,18 +55,20 @@ export default function reactSubRouter(app) {
}
return !!props;
})
.flatMap(({ props, store }) => {
.flatMap(({ props, store, epic }) => {
log('render react markup and pre-fetch data');
return renderToString(
provideStore(React.createElement(RouterContext, props), store)
provideStore(React.createElement(RouterContext, props), store),
epic
)
.map(({ markup }) => ({ markup, store }));
.map(({ markup }) => ({ markup, store, epic }));
})
.flatMap(function({ markup, store }) {
.flatMap(function({ markup, store, epic }) {
log('react markup rendered, data fetched');
const state = store.getState();
const { title } = state.app.title;
epic.dispose();
res.expose(state, 'data');
return res.render$(
'layout-react',