I like to cache my subscriptions using a setTimeout. When I no longer need a subscriptions I do something like
id = Meteor.setTimeout(function() {
sub.stop()
}, 1000*60*2)
which will cache the subscription for 2 minutes before stopping it. But if I some back to the same page to resubscribe, I can just cancel the timeout Meteor.clearTimeout(id)
. This works great. But when I call Meteor._reload.reload()
, the timeouts are forgotten and now I have some subscriptions that will live on forever.
Any ideas how to clear these subscriptions on live-reloads?