jamauro / offline

An easy way to give your Meteor app offline capabilities and make it feel instant
13 stars 1 forks source link

Feature request: Offline queued method count and sync progress count #8

Open wildhart opened 4 weeks ago

wildhart commented 4 weeks ago

Thanks for making isSyncing() available, and reactive/trackable!

I would like to diplay to my offline user:

I propose a new reactive/trackable method offlineStatus() which returns:

{
    queueLength: number,
    isSyncing: boolean, // this is a copy of the isSycing() method, just so we don't need to use both?
    syncCount: number,
    initialSyncCount: number,  
}

The purpose of the initialSyncCount number is so we can diplay the sync status as Syncing... 3 of 21, or Syncing... 10%. As the sync proceeds the queueLength would decrease, but the initialSyncCount would stay the same - just to make it easier to diplay the progress without having to remember the initial queue length. Looking at your code I think this would be easy to provide.

I'm happy to work on a PR if you want? If so, feel free to suggest alternative method name & response format, since this will be your API to maintain!