浏览代码

refactor: change `removeListener` to `off` for consitency

Jonas Gloning 1 年之前
父节点
当前提交
15311d9940
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/eventEmitterWithPromise.ts

+ 1 - 1
lib/eventEmitterWithPromise.ts

@@ -45,7 +45,7 @@ export class EventEmitterWithPromise<
 				resolve?.(proxyWithoutThen(this));
 				resolve?.(proxyWithoutThen(this));
 			};
 			};
 			const onError = (err: PeerError<`${ErrorType}`>) => {
 			const onError = (err: PeerError<`${ErrorType}`>) => {
-				this.removeListener("open", onOpen);
+				this.off("open", onOpen);
 				reject(err);
 				reject(err);
 			};
 			};
 			if (this._open) {
 			if (this._open) {