Skip to content

Commit

Permalink
Merge pull request #667 from Tyriar/add_missing_emit_arg
Browse files Browse the repository at this point in the history
Add missing EventEmitter.emit args/types
  • Loading branch information
Tyriar committed May 22, 2017
2 parents a95ac99 + ea00841 commit 0fab4ff
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/EventEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,11 @@ export class EventEmitter {
return this.on(type, on);
}

public emit(type): void {
public emit(type: string, ...args: any[]): void {
if (!this._events[type]) {
return;
}

let args = Array.prototype.slice.call(arguments, 1);
let obj = this._events[type];

for (let i = 0; i < obj.length; i++) {
obj[i].apply(this, args);
}
Expand Down

0 comments on commit 0fab4ff

Please sign in to comment.