From ab8b364322668ac9130fa2e0f271679a8e2c7145 Mon Sep 17 00:00:00 2001 From: William So Date: Wed, 10 Apr 2024 03:09:36 +0800 Subject: [PATCH] Improve code slightly Signed-off-by: William So --- sources/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/util.ts b/sources/util.ts index 246a21d..49d3a63 100644 --- a/sources/util.ts +++ b/sources/util.ts @@ -49,7 +49,7 @@ export class EventEmitterLite { readonly #listeners: ((...args: A) => unknown)[] = [] public async emit(...args: A): Promise { - 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]