Skip to content

Instantly share code, notes, and snippets.

@nicolaslopezj
Created August 30, 2016 12:19
Show Gist options
  • Save nicolaslopezj/e96d32dd6506eaf5b1fb2548dd13facb to your computer and use it in GitHub Desktop.
Save nicolaslopezj/e96d32dd6506eaf5b1fb2548dd13facb to your computer and use it in GitHub Desktop.
class Component extends React.Component {
render () {
if (this.props.isLoading) return <span/>
return (
<div>
{this.props.item.name}
</div>
)
}
}
export default createContainer(({itemId}) => {
const handler = Meteor.subscribe('myPublication', itemId)
const isLoading = !handler.ready()
const item = MyCollection.findOne(itemId)
return {isLoading, item}
}, Component)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment