Skip to content

Commit

Permalink
refactor .once
Browse files Browse the repository at this point in the history
  • Loading branch information
lusever authored and jonathanong committed Dec 26, 2014
1 parent 5890152 commit 7abd6b0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@ Emitter.prototype.addEventListener = function(event, fn){
*/

Emitter.prototype.once = function(event, fn){
var self = this;
this._callbacks = this._callbacks || {};

function on() {
self.off(event, on);
this.off(event, on);
fn.apply(this, arguments);
}

Expand Down

0 comments on commit 7abd6b0

Please sign in to comment.