Why the follow code works in Iron router, when I'm subscribing several collections at the same time, Im returning Collection1&&Collection2 etc
[view code].
I read this question Multiple subscriptions in iron router where he is suggesting to add several subscriber via an array
, I'm doing different just cause is working and I found was working after try and error. But to be honest I don't know why is working. Can someone explain why conditions works to return all the collections?.
Meteor.startup(function(){
Router.route('/',
{
name : "dashboard",
waitOn : function(){
if(!Meteor.loggingIn() && !Meteor.user()) {
this.redirect("login");
}
return Meteor.subscribe("collection_1") &&
Meteor.subscribe("collection_2") &&
Meteor.subscribe("collection_3") &&
Meteor.subscribe("collection_4");
},
onBeforeAction : function(){
if(!Meteor.loggingIn() && !Meteor.user()) {
this.redirect("login");
}
this.next();
},
action : function(){
this.render();
}
});
});