0

If I have one subscription that will be used for multiple routes, should I call it each time in every controller's waitOn or is there a better place?

ilyo
  • 35,851
  • 46
  • 106
  • 159

1 Answers1

1

There are few ways to go:

subscribe on client startup

If your collection is small and used often then it could be beneficial to subscribe only once in Meteor.startup on client side. That subscription won't be stopped when route is changed.

cache subscriptions

There is Subscription Manager which should allow to cache subscriptions, so subscriptions are not stopped every time route is changed.

https://github.com/meteorhacks/subs-manager

Kuba Wyrobek
  • 5,273
  • 1
  • 24
  • 26