A
A
Alexander Wolf2015-11-02 00:49:56
JavaScript
Alexander Wolf, 2015-11-02 00:49:56

How do meteor subscriptions work?

Good evening! I need some info about meteor subscriptions. Namely, when working with iron:router.
In each route, I have waitOn set, which ensures that the data is loaded in a timely manner.
When publishing, I use the publish-composite package, which provides some sugar. So, when moving from one route to another, if the same collections are used, is everything reloaded or just updated to the current state?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel, 2015-11-02
@mannaro

Here is a great article about optimizing subscriptions, you will find the answer there
ps: I advise you to move to flow-router :)

E
E, 2015-11-13
@aylo

If on route A you have Meteor.subscribe('getAllPost'), and on route B you have Meteor.subscribe('getSinglePost'), then the getAllPost subscription will be terminated and the data from the client will go to oblivion. In general, as I understand it, you are talking about caching, as far as I know, there is no caching of subscriptions out of the box in the meteor. waitOn provides you with a timely loading of data from the server and shows the loader, for example.
PS: Don't forget that publish-composite publishes both parent and child fields, and most likely even all fields.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question