Skip to content

Commit

Permalink
fix: treat 0 max listeners as no limit
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Dec 21, 2022
1 parent e83fa24 commit 3265feb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export class Emitter<Events extends EventMap> {
this.#events.set(eventName, nextListeners)

if (
this.#maxListeners > 0 &&
this.listenerCount(eventName) > this.#maxListeners &&
!this.#hasWarnedAboutPotentialMemortyLeak
) {
Expand Down

0 comments on commit 3265feb

Please sign in to comment.