redux-fetch-data
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "redux-fetch-data", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Redux utility library for fetching data using promises on both server and client.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -41,3 +41,3 @@ # redux-fetch-data | ||
// Renders the actual HTML page | ||
function renderHtml(html) { | ||
function renderHtml(html, state) { | ||
return ` | ||
@@ -48,3 +48,3 @@ <!doctype html> | ||
<div id="root">${html}</div> | ||
<script dangerouslySetInnerHTML={{__html: `window.__INITIAL_STATE__=${JSON.stringify(store.getState())};`}} | ||
<script dangerouslySetInnerHTML={{__html: `window.__INITIAL_STATE__=${JSON.stringify(state)};`}} | ||
charSet="UTF-8"/> | ||
@@ -78,3 +78,3 @@ </body> | ||
// Send the rendered page back to the client | ||
res.status(200).send(render(html)); | ||
res.status(200).send(render(html, store.getState())); | ||
} else { | ||
@@ -81,0 +81,0 @@ res.status(404).send('Not found.'); |
270236