mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
36 lines
No EOL
677 B
JavaScript
36 lines
No EOL
677 B
JavaScript
const AppContainer = React.createClass({
|
|
|
|
mixins: [ReactMeteorData],
|
|
|
|
getMeteorData() {
|
|
|
|
var data = {
|
|
ready: false
|
|
};
|
|
|
|
var handles = Telescope.subscriptions.map((sub) => Meteor.subscribe(sub.name, sub.arguments));
|
|
|
|
if(!handles.length || _.every(handles, handle => handle.ready())) {
|
|
data.ready = true;
|
|
}
|
|
|
|
return data;
|
|
},
|
|
|
|
|
|
render() {
|
|
|
|
const Layout = Telescope.getComponent("Layout");
|
|
|
|
if (this.data.ready) {
|
|
return <Layout>{this.props.content}</Layout>
|
|
} else {
|
|
return <p>Loading App…</p>
|
|
}
|
|
|
|
// return this.data.ready ? this.props.content : <Loading/>;
|
|
}
|
|
|
|
});
|
|
|
|
module.exports = AppContainer; |