Minor net2 cleanup

This commit is contained in:
Jon Staab
2025-03-24 13:35:43 -07:00
parent b985003333
commit d7b74d2c7e
6 changed files with 39 additions and 24 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ export type SubscriptionOptions = {
timeout?: number
tracker?: Tracker
verifyEvent?: (event: SignedEvent) => boolean
events?: Partial<SubscriptionEvents>
on?: Partial<SubscriptionEvents>
}
export class Subscription extends (EventEmitter as new () => TypedEmitter<SubscriptionEvents>) {
@@ -102,8 +102,8 @@ export class Subscription extends (EventEmitter as new () => TypedEmitter<Subscr
}
// Register listeners
if (this.options.events) {
for (const [k, listener] of Object.entries(this.options.events)) {
if (this.options.on) {
for (const [k, listener] of Object.entries(this.options.on)) {
this.on(k as keyof SubscriptionEvents, listener)
}
}