meteor-dumb-collections icon indicating copy to clipboard operation
meteor-dumb-collections copied to clipboard

Reuse subscriptions after a disconnect/connect cycle on mobile apps

Open joaopiopedreira opened this issue 9 years ago • 0 comments

Hi @richsilv , I'm using your package in a mobile app (meteor-cordova app), already in pre-production.

I had 2 main problems to solve in this app:

  • Treat static, potentially big collections outside of meteor livedata package (no pub/sub): got this with your package (thank you for that!); I'll post some issues I'm having with it and a couple of improvement suggestions in another issue;
  • Try to reuse subscriptions between offline/online transitions, even when the browser refreshes. This is to avoid the overhead caused by reloading all data associated to subscribed collections on an offline/online transition (my users may be in zones with a poor network coverage, experiencing many reloads in a short intervals of time)

This last issue is giving me some work. It's a hard problem to solve. I though I could hold on to the subscription handle, save it in local storage and then find a way to reuse it like this:

//subsHandle holds the subs object before refresh
// after refresh, I could hold on to it like:
subsHandle = Meteor.subscribe(...)

But it's not that simple. Do you think there's a way to achieve this?

Thanks

joaopiopedreira avatar May 22 '15 18:05 joaopiopedreira