Sunday, 15 January 2012

iron router - The best pattern to organize my subscriptions in Meteor without the risk to find the data not ready -


I've read some posts here how to organize membership in metiovos, but I still can not understand that I subscribe Are not ready to use the best pattern template to avoid finding some of the data. I use an iron router and now all my memberships are arranged using a wait-over option in the router. Configure I know that this sometimes does not help if I have multiple subscriptions like this:

  router Configurable ({layout template: 'layout', loading template: 'loading', wait-on: function () {returns [Meter Soutabrb ('channel'), metier subscribe ('invitation'), metier subscribe ('message')]}} );  

I think the order matters. If I change the order of my membership in the array, the program responds differently. What do I want to do to complete all my subscriptions before navigating the app? In the previous post, someone talked about putting them in a separate file to solve this problem. but how? Where should I put that file? I appreciate some examples for my case.

with the release of meteor 1.0.4 now a subscription in template instances The method that works just like Meteor.subscribe , check notes about more information

so that you can use that membership to follow the onCreated example Please.

  Template.notifications.onCreated (function () {this.subscribe ("channel"); this.subscribe ("invitations"); this.subscribe ("message");});  

Check for subscriptions ()


No comments:

Post a Comment