Skip to content

Commit

Permalink
hypernova v2 returns array for load
Browse files Browse the repository at this point in the history
  • Loading branch information
zBradw committed Nov 3, 2016
1 parent 9b2ca7b commit 2e89f98
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
21 changes: 11 additions & 10 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ var renderReactRedux = function (name, connectedComponent, configureStore) {
},

client: function client() {
var _load = load(name);

var node = _load.node;
var data = _load.data;

if (node) {
var provider = buildProvider(connectedComponent, configureStore(data));
ReactDOM.render(provider, node);
var payloads = load(name);
if (payloads) {
payloads.forEach(function (payload) {
var node = payload.node;
var data = payload.data;

var provider = buildProvider(connectedComponent, configureStore(data));
ReactDOM.render(provider, node);
});
}

return connectedComponent;
} });
}
});
};
exports.renderReactRedux = renderReactRedux;
15 changes: 8 additions & 7 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ export const renderReactRedux =
},

client() {
const { node, data } = load(name);

if (node) {
const provider = buildProvider(connectedComponent, configureStore(data));
ReactDOM.render(provider, node);
const payloads = load(name);
if (payloads) {
payloads.forEach((payload) => {
const { node, data } = payload;
const provider = buildProvider(connectedComponent, configureStore(data));
ReactDOM.render(provider, node);
});
}

return connectedComponent;
},
}
});

0 comments on commit 2e89f98

Please sign in to comment.