From 701a3190aeb9448486504abc9dfc7de52efed5b2 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 5 Feb 2023 14:02:53 -0500 Subject: [PATCH] *Convert more api methods to use _processOrQueueAction --- src/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4402a7c..842375f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -198,17 +198,17 @@ export default class HyperswarmWeb extends EventEmitter { this._queuedEmActions = []; } - public join(topic: Uint8Array, opts = {}) { - return this._activeRelay?.join(topic, opts); + public join(topic: Uint8Array, opts = {}): void { + return this._processOrQueueAction("join", ...arguments); } - public joinPeer(publicKey: Uint8Array) { - return this._activeRelay?.joinPeer(publicKey); + public joinPeer(publicKey: Uint8Array): void { + return this._processOrQueueAction("joinPeer", ...arguments); } - public leave(topic: Uint8Array) { - return this._activeRelay?.leave(topic); + public leave(topic: Uint8Array): void { + return this._processOrQueueAction("leave", ...arguments); } - public leavePeer(publicKey: Uint8Array) { - return this._activeRelay?.leavePeer(publicKey); + public leavePeer(publicKey: Uint8Array): void { + return this._processOrQueueAction("leavePeer", ...arguments); } public status(publicKey: Uint8Array) { return this._activeRelay?.status(publicKey);