Skip to content

Instantly share code, notes, and snippets.

@nathankleyn
Created December 12, 2012 12:06
Show Gist options
  • Save nathankleyn/4267277 to your computer and use it in GitHub Desktop.
Save nathankleyn/4267277 to your computer and use it in GitHub Desktop.
This is an example of how to handle the /gd/shared event and count the number of shares.
gd.init().then(function() {
var shares = 0;
gd.event('/gd/shared').subscribe(function() {
shares += 1;
// Do whatever else you would like here...
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment