From 54723979589e5940222de00554128b69d91b099a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 1 Feb 2023 04:50:55 -0500 Subject: [PATCH] *Need to pass arguments as a spread --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 18e1bf0..ecc0132 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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[]) {