You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I seem to be having an issue or potentially misunderstanding tracker statements.
I see that in the Readme file, there is a Meteor.subscribe call inside a tracker statement $m. If I do that in my meteor app, my subscriptions get multiplied. If I use Tracker.autorun instead, they don't.
Using "$m" for the "mainObjects-sources" subscription:
Using Tracker.autorun:
Could you please clarify what exactly is the difference between using $m and Tracker.autorun? And why should we put "Meteor.subscribe" calls inside tracker statements if it leads to the subscriptions being multiplied?
Thanks!
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. Subscriptions should work the same with both $m and Tracker.autorun, with $m automatically ending the subscriptions when the component instance is destroyed. I will see if I can reproduce the subscriptions being duplicated. In your code, where is mainObjectId coming from, and when can it change?
Do you have rdb:svelte-meteor-data installed? I just came across a similar thing, that the sub was called twice (two different ids). Removing svelte-meteor-data fixed it.
With the zodern's suggested implementation (while having svelte-meteor-data installed) it was even causing a memory leak (when the page was embedded on another page), creating thousands of subs (thanks MontiAPM for pointing me in the right direction)
Hey, I seem to be having an issue or potentially misunderstanding tracker statements.
I see that in the Readme file, there is a Meteor.subscribe call inside a tracker statement $m. If I do that in my meteor app, my subscriptions get multiplied. If I use Tracker.autorun instead, they don't.
Using "$m" for the "mainObjects-sources" subscription:
Using Tracker.autorun:
Could you please clarify what exactly is the difference between using $m and Tracker.autorun? And why should we put "Meteor.subscribe" calls inside tracker statements if it leads to the subscriptions being multiplied?
Thanks!
The text was updated successfully, but these errors were encountered: