*Add offSelf and onceSelf
This commit is contained in:
parent
f5d93fe03d
commit
9102cc77d5
14
src/index.ts
14
src/index.ts
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue