Compare commits

..

No commits in common. "9ae03e12e2c9643392e68b0ae5645eeb52dc3225" and "6a843447b1d2964fa3acb8dd90723a6c6807a658" have entirely different histories.

2 changed files with 8 additions and 8 deletions

8
dist/index.js vendored
View File

@ -95,22 +95,22 @@ export default class HyperswarmWeb extends EventEmitter {
this._relays.clear(); this._relays.clear();
} }
on(eventName, listener) { on(eventName, listener) {
return this._processOrQueueAction("on", ...arguments); return this._processOrQueueAction("on", arguments);
} }
addListener(eventName, listener) { addListener(eventName, listener) {
return this.on(eventName, listener); return this.on(eventName, listener);
} }
off(eventName, listener) { off(eventName, listener) {
return this._processOrQueueAction("off", ...arguments); return this._processOrQueueAction("off", arguments);
} }
removeListener(eventName, listener) { removeListener(eventName, listener) {
return this.off(eventName, listener); return this.off(eventName, listener);
} }
emit(eventName, ...args) { emit(eventName, ...args) {
return this._processOrQueueAction("emit", ...arguments); return this._processOrQueueAction("emit", arguments);
} }
once(eventName, listener) { once(eventName, listener) {
return this._processOrQueueAction("once", ...arguments); return this._processOrQueueAction("once", arguments);
} }
_processOrQueueAction(method, ...args) { _processOrQueueAction(method, ...args) {
if (this._activeRelay) { if (this._activeRelay) {

View File

@ -132,7 +132,7 @@ export default class HyperswarmWeb extends EventEmitter {
eventName: string | symbol, eventName: string | symbol,
listener: (...args: any[]) => void listener: (...args: any[]) => void
): Hyperswarm { ): Hyperswarm {
return this._processOrQueueAction("on", ...arguments); return this._processOrQueueAction("on", arguments);
} }
addListener( addListener(
eventName: string | symbol, eventName: string | symbol,
@ -145,7 +145,7 @@ export default class HyperswarmWeb extends EventEmitter {
eventName: string | symbol, eventName: string | symbol,
listener: (...args: any[]) => void listener: (...args: any[]) => void
): Hyperswarm { ): Hyperswarm {
return this._processOrQueueAction("off", ...arguments); return this._processOrQueueAction("off", arguments);
} }
removeListener( removeListener(
@ -155,11 +155,11 @@ export default class HyperswarmWeb extends EventEmitter {
return this.off(eventName, listener); return this.off(eventName, listener);
} }
emit(eventName: string | symbol, ...args: any[]): boolean { 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 { 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[]) { private _processOrQueueAction(method: string, ...args: any[]) {