Skip to content

Instantly share code, notes, and snippets.

View shawnbierman's full-sized avatar
🎯
type type type

Shawn Bierman shawnbierman

🎯
type type type
View GitHub Profile
@shawnbierman
shawnbierman / pubsub.js
Created December 20, 2010 21:25
unsubscribing
// Given the following namespaced objects
// a widget
Namespace('km.widget.edVolGraph', {
handle: 'undefined',
load: function() {
handle = $.subscribe('xmlFetch', function() {
// do stuff
});
xmlFetch: function() {
timerId = setInterval(function() {
$.get(url, function(xml) {
$.publish('xmlFetch', [xml]);
});
}, interval);
}