Compare commits
2 Commits
6a843447b1
...
9ae03e12e2
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 9ae03e12e2 | |
Derrick Hammer | 5472397958 |
|
@ -95,22 +95,22 @@ export default class HyperswarmWeb extends EventEmitter {
|
|||
this._relays.clear();
|
||||
}
|
||||
on(eventName, listener) {
|
||||
return this._processOrQueueAction("on", arguments);
|
||||
return this._processOrQueueAction("on", ...arguments);
|
||||
}
|
||||
addListener(eventName, listener) {
|
||||
return this.on(eventName, listener);
|
||||
}
|
||||
off(eventName, listener) {
|
||||
return this._processOrQueueAction("off", arguments);
|
||||
return this._processOrQueueAction("off", ...arguments);
|
||||
}
|
||||
removeListener(eventName, listener) {
|
||||
return this.off(eventName, listener);
|
||||
}
|
||||
emit(eventName, ...args) {
|
||||
return this._processOrQueueAction("emit", arguments);
|
||||
return this._processOrQueueAction("emit", ...arguments);
|
||||
}
|
||||
once(eventName, listener) {
|
||||
return this._processOrQueueAction("once", arguments);
|
||||
return this._processOrQueueAction("once", ...arguments);
|
||||
}
|
||||
_processOrQueueAction(method, ...args) {
|
||||
if (this._activeRelay) {
|
||||
|
|
|
@ -132,7 +132,7 @@ export default class HyperswarmWeb extends EventEmitter {
|
|||
eventName: string | symbol,
|
||||
listener: (...args: any[]) => void
|
||||
): Hyperswarm {
|
||||
return this._processOrQueueAction("on", arguments);
|
||||
return this._processOrQueueAction("on", ...arguments);
|
||||
}
|
||||
addListener(
|
||||
eventName: string | symbol,
|
||||
|
@ -145,7 +145,7 @@ export default class HyperswarmWeb extends EventEmitter {
|
|||
eventName: string | symbol,
|
||||
listener: (...args: any[]) => void
|
||||
): Hyperswarm {
|
||||
return this._processOrQueueAction("off", arguments);
|
||||
return this._processOrQueueAction("off", ...arguments);
|
||||
}
|
||||
|
||||
removeListener(
|
||||
|
@ -155,11 +155,11 @@ export default class HyperswarmWeb extends EventEmitter {
|
|||
return this.off(eventName, listener);
|
||||
}
|
||||
emit(eventName: string | symbol, ...args: any[]): boolean {
|
||||
return this._processOrQueueAction("emit", arguments);
|
||||
return this._processOrQueueAction("emit", ...arguments);
|
||||
}
|
||||
|
||||
once(eventName: string | symbol, listener: (...args: any[]) => void): this {
|
||||
return this._processOrQueueAction("once", arguments);
|
||||
return this._processOrQueueAction("once", ...arguments);
|
||||
}
|
||||
|
||||
private _processOrQueueAction(method: string, ...args: any[]) {
|
||||
|
|
Loading…
Reference in New Issue