From 1b04799943fb0eede32e92be8046c01aaf9078e3 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 1 Sep 2023 08:24:55 -0400 Subject: [PATCH] refactor: listen only needs to return the done handler --- src/service/registry.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/service/registry.ts b/src/service/registry.ts index 2459ba5..0f31650 100644 --- a/src/service/registry.ts +++ b/src/service/registry.ts @@ -212,7 +212,7 @@ export class RegistryService { public listen( pk: Uint8Array, cb: (sre: SignedRegistryEntry) => void, - ): ((() => void) | EventEmitter)[] { + ): () => void { const key = new Multihash(pk).toString(); if (!this.streams[key]) { this.streams[key] = new EventEmitter(); @@ -226,7 +226,7 @@ export class RegistryService { stream.on("event", cb); - return [done, stream]; + return done; } public deserializeRegistryEntry(event: Uint8Array): SignedRegistryEntry {