Created
August 30, 2016 12:19
-
-
Save nicolaslopezj/e96d32dd6506eaf5b1fb2548dd13facb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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