Skip to content

Instantly share code, notes, and snippets.

@shawnbierman
Created December 17, 2010 15:48
Show Gist options
  • Save shawnbierman/745144 to your computer and use it in GitHub Desktop.
Save shawnbierman/745144 to your computer and use it in GitHub Desktop.
x
xmlFetch: function() {
timerId = setInterval(function() {
$.get(url, function(xml) {
$.publish('xmlFetch', [xml]);
});
}, interval);
}
Namespace('km.widget.edVolGraph', {
handle: 'nothingYet',
load: function(){
handle=$.subscribe('xmlFetch', function(){
// do more here
});
}
});
@shawnbierman
Copy link
Author

If I create two 'km.widget.edVolGraph' widgets, how do I differentiate between the two when I want to unsubscribe just one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment