From the server side, from now on, observe works as follows:
- Build a set of documents matching the query.
- Poll the database with the query regularly and make the difference between the changes by emitting the appropriate events for callbacks.
- When the corresponding data is changed / inserted into mongo by the meteorite itself, highlight the corresponding events, short-circuit step No. 2 above.
There are plans (perhaps in the next release) to automatically ensure that calls for a subscription that have the same arguments are shared. So basically taking care of the singleton part is automatic for you.
Of course, you could achieve something similar, but I think this is very important for the meteor team, so at the moment this is probably not worth the effort.
source share