Is there a way to have conditional waitOn for Ironrouter?
For one of the routes, we sometimes need the waitOn option, and sometimes we
don’t need the waitOn option…
I have tested the following but it doesn’t seem to work…
Router.route('/myroute/:_myparameter', {
waitOn: function() {
if (this.params._myparameter === "blabla") {
return true
} else {
return some_subscription
}
},
action: function() {
if (subs.ready()) {
if (this.params._parameter === "blabla") {
this.render('View1');
} else {
this.render('View2');
}
} else {
this.render('Loading');
}
}
});
PS: At the moment I’m stuck with Ironrouter in some code I have inherited. Hopefully this changes in the coming months