Skip to content

Commit

Permalink
Improve code slightly
Browse files Browse the repository at this point in the history
Signed-off-by: William So <[email protected]>
  • Loading branch information
polyipseity committed Apr 9, 2024
1 parent ed91992 commit ab8b364
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sources/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class EventEmitterLite<A extends readonly unknown[]> {
readonly #listeners: ((...args: A) => unknown)[] = []

public async emit(...args: A): Promise<void> {
return new Promise((resolve, reject: (reason?: unknown) => unknown) => {
return new Promise((resolve, reject: (reason?: unknown) => void) => {
this.lock.acquire(EventEmitterLite.emitLock, async () => {
// Copy to prevent concurrent modification
const emitted = [...this.#listeners]
Expand Down

0 comments on commit ab8b364

Please sign in to comment.