Skip to content
This repository has been archived by the owner on Jul 18, 2019. It is now read-only.

Commit

Permalink
updated Emitter example returning this
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Jan 20, 2013
1 parent d9d00ce commit 6d0e84c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ This is how we can define the prototype of the `Emitter` class.
if (type in this._handlers) {
this._handlers[type].forEach(emit, data);
}
return this;
},
on: function (type, handler) {
var list = this._getList(type);
Expand All @@ -134,6 +135,7 @@ This is how we can define the prototype of the `Emitter` class.
}
}
}
return this;
},
_getList: function (type) {
return this._handlers[type] || (
Expand Down Expand Up @@ -162,6 +164,7 @@ When listeners are removed, both Array used as type list and `_handlers` are rem
if (type in this._handlers) {
this._handlers[type].forEach(emit, data);
}
return this;
}
},
on: {
Expand All @@ -184,6 +187,7 @@ When listeners are removed, both Array used as type list and `_handlers` are rem
}
}
}
return this;
}
},
_getList: {
Expand Down

0 comments on commit 6d0e84c

Please sign in to comment.