Skip to content

Instantly share code, notes, and snippets.

@jiverson
Created June 16, 2014 03:49
Show Gist options
  • Save jiverson/6fae35cdebf1f8548094 to your computer and use it in GitHub Desktop.
Save jiverson/6fae35cdebf1f8548094 to your computer and use it in GitHub Desktop.
deregistration
$on: function(name, listener) {
var namedListeners = this.$$listeners[name];
if (!namedListeners) {
this.$$listeners[name] = namedListeners = [];
}
namedListeners.push(listener);
return function() {
namedListeners[indexOf(namedListeners, listener)] = null;
};
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment