I’ve got something like this:
Router.route('/:uid', {
name: 'lookup',
data: function () {
Meteor.call('fetch', this.params.uid, function (error, result) {
if (typeof error === 'undefined') {
console.log(result);
return result;
} else {
return {};
}
});
}
});
The problem is, the lookup template is done rendering before the data is ready (the call to the fetch method makes a couple API calls), since Meteor.call
is asynchronous. What I’d like is to use something like waitOn
, but that doesn’t solve the async problem.
I’m out of ideas.