Skip to content

Instantly share code, notes, and snippets.

@pahans
Created June 14, 2014 21:57
Show Gist options
  • Select an option

  • Save pahans/bb59ece15ce156092f4c to your computer and use it in GitHub Desktop.

Select an option

Save pahans/bb59ece15ce156092f4c to your computer and use it in GitHub Desktop.
meteor connection status
var connectionRetry;
Deps.autorun(function(){
var retryTime = Meteor.status().retryTime;
if(retryTime && !connectionRetry){
connectionRetry = setInterval(function(){
var newRetryTime = ((Meteor.status().retryTime - (new Date()).getTime())/1000).toFixed(0);
$("#meteor-connect-retry-time").html(newRetryTime);
}, 1000);
}
if(retryTime > 0){
$("#meteor-connect-retry-time").html(retryTime);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment