Skip to content

Instantly share code, notes, and snippets.

@dillongreen
Last active January 2, 2016 04:19
Show Gist options
  • Save dillongreen/8249758 to your computer and use it in GitHub Desktop.
Save dillongreen/8249758 to your computer and use it in GitHub Desktop.
meteor template helper for client connection status template seen at https://gist.github.com/8249761
Template.navbar.connection_status = function () {
var connection_status = Meteor.status().status;
var retryCount = Meteor.status().retryCount;
switch(connection_status){
case "connected":
return { label: "label-success",
connection_status: connection_status};
case "waiting":
return { label: "label-warning",
connection_status: connection_status,
retryCount: retryCount};
case "connecting":
return { label: "label-info",
connection_status: connection_status};
case "failed":
return { label: "label-danger",
connection_status: connection_status};
case "offline":
return { label: "label-default",
connection_status: connection_status};
}
return null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment