Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 783 Bytes

whileWaiting.md

File metadata and controls

26 lines (20 loc) · 783 Bytes

whileWaiting hook

whileWaiting(params, qs)

  • params {Object} - Serialized route parameters, /route/:_id => { _id: 'str' }
  • qs {Object} - Serialized query string, /route/?key=val => { key: 'val' }
  • Return: {void}

.whileWaiting() hook is triggered before .waitOn() hook, allowing to display/render text or animation saying Loading....

FlowRouter.route('/post/:_id', {
  name: 'post',
  whileWaiting() {
    this.render('loading');
  },
  waitOn(params) {
    return Meteor.subscribe('post', params._id);
  }
});

Further reading