Kurounin / Pagination

This package allows you to paginate the subscriptions over meteor's collections. It can be used in a Blaze template or in ReactJS.
MIT License
56 stars 22 forks source link

Is there a recommended way to "close" a pagination? #103

Closed carlosalvidrez closed 1 year ago

carlosalvidrez commented 1 year ago

The meteor web plugin shows active subscriptions for previous visits of the same page (each visit calls for a different single document). So, I wonder if the template's "destroyed" event could be used to "kill" the pagination, to free memory or the number of connections/trackers on the server (the meteor plugin lists multiple, one per visit, all as "active" and "ready"). Thanks!

Kurounin commented 1 year ago

I don't know if something changed in the meantime, since I haven't been using the package for some years, but it's relying on the existing Meteor.connection to create a subscription when you initialize a pagination. Meteor is supposed to close the active subscriptions on server side whenever the client side connection is closed as far as I remember.

carlosalvidrez commented 1 year ago

Yes, I believe it does close it... I just want to control when to "kill the subscription"/pagination, when no longer required. To save on the number of polls back to the dB. Thanks Kurounin, I appreciate your response.