I read some of the posts here on how to organize subscriptions in Meteorjs, but I still don’t understand which template is the best, so as not to find some of the data that I signed up, not ready for use in the template. I use Iron Router and now I have all my subscriptions organized using the waitOn option in Router.configure. I find out that this method sometimes does not help. If I have several signatures like this:
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
waitOn: function () {
return [
Meteor.subscribe('channels'),
Meteor.subscribe('invitations'),
Meteor.subscribe('messages')
];
}
});
I realized that order matters. If I change the order of my subscriptions in an array, the program will respond differently. I want to get ALL my subscriptions fully loaded before navigating the application. Someone in a previous post talked about putting them in a separate file in order to solve this problem. But how? Where do I need to put this file? I would appreciate some examples for my case.
source
share