*Add offSelf and onceSelf

This commit is contained in:
Derrick Hammer 2023-03-19 13:23:07 -04:00
parent f5d93fe03d
commit 9102cc77d5
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 14 additions and 0 deletions

View File

@ -105,6 +105,13 @@ export default class HyperswarmWeb extends EventEmitter {
return this._processOrQueueAction("off", ...arguments);
}
offSelf(
eventName: string | symbol,
listener: (...args: any[]) => void
): Hyperswarm {
return super.off(eventName, listener);
}
removeListener(
eventName: string | symbol,
listener: (...args: any[]) => void
@ -124,6 +131,13 @@ export default class HyperswarmWeb extends EventEmitter {
return this._processOrQueueAction("once", ...arguments);
}
onceSelf(
eventName: string | symbol,
listener: (...args: any[]) => void
): this {
return this.once(eventName, listener);
}
public join(topic: Uint8Array, opts = {}): void {
return this._processOrQueueAction("join", ...arguments);
}