refactor: listen only needs to return the done handler
This commit is contained in:
parent
427c423b2c
commit
1b04799943
|
@ -212,7 +212,7 @@ export class RegistryService {
|
||||||
public listen(
|
public listen(
|
||||||
pk: Uint8Array,
|
pk: Uint8Array,
|
||||||
cb: (sre: SignedRegistryEntry) => void,
|
cb: (sre: SignedRegistryEntry) => void,
|
||||||
): ((() => void) | EventEmitter)[] {
|
): () => void {
|
||||||
const key = new Multihash(pk).toString();
|
const key = new Multihash(pk).toString();
|
||||||
if (!this.streams[key]) {
|
if (!this.streams[key]) {
|
||||||
this.streams[key] = new EventEmitter();
|
this.streams[key] = new EventEmitter();
|
||||||
|
@ -226,7 +226,7 @@ export class RegistryService {
|
||||||
|
|
||||||
stream.on("event", cb);
|
stream.on("event", cb);
|
||||||
|
|
||||||
return [done, stream];
|
return done;
|
||||||
}
|
}
|
||||||
|
|
||||||
public deserializeRegistryEntry(event: Uint8Array): SignedRegistryEntry {
|
public deserializeRegistryEntry(event: Uint8Array): SignedRegistryEntry {
|
||||||
|
|
Loading…
Reference in New Issue