Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save acodesmith/6b0dbfb5b251bd4883fae0f5afa1524c to your computer and use it in GitHub Desktop.
Save acodesmith/6b0dbfb5b251bd4883fae0f5afa1524c to your computer and use it in GitHub Desktop.
Template.restaurant.onCreated(function() {
let restaurantSub = this.subscribe( 'Restaurant', [ FlowRouter.getParam('restaurantId') ] )
, restaurantPromise = restaurantSub.readyPromise()
this.restaurant = new ReactiveVar()
this.ready = new ReactiveVar( false )
restaurantPromise.then(function(){
this.restaurant.set( Restaurant.findOne() )
this.ready.set( true )
}.bind(this))
})
@acodesmith
Copy link
Author

Thanks for the tip, much better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment