From 7eabf6a05da9dcd833b55f386896a70fa6ec736d Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 22 Jul 2023 06:11:18 -0400 Subject: [PATCH] fix: return type required --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 06c79ec..6769b6b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,7 @@ import b4a from "b4a"; import Backoff from "backoff.js"; // @ts-ignore import Protomux from "protomux"; +import { UnsubscribeFn } from "emittery"; export class SwarmClient extends Client { private useDefaultSwarm: boolean; @@ -188,7 +189,7 @@ export class Socket extends Client { await this.swarm.emit("setup", this); } - on(event: any, listener: any) { + on(event: any, listener: any): UnsubscribeFn { const parentOn = super.on(event, listener); if (this.eventUpdates[event]?.has(listener)) { return parentOn;