Skip to content

Commit

Permalink
Added event name error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicat-dcw authored Feb 16, 2023
1 parent e4a1794 commit ea7f1e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Classes/eventemitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class EventEmitter extends EE{
* @returns
*/
emit(eventName, ...args){
if(!eventName) throw new Error("Event Name is required for action.")
this.emittedEventNames.push(event)
this.emittedEvents.push({
eventName,
Expand Down

0 comments on commit ea7f1e1

Please sign in to comment.