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?

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.