From 5b443ed66dc7ef50a3f09dc8dde8fab4246da1e1 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 8 Apr 2023 18:03:37 -0400 Subject: [PATCH] * Refactor code to open channel and await for it to be ready. --- src/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 1dccad6..058cb71 100644 --- a/src/index.ts +++ b/src/index.ts @@ -80,9 +80,7 @@ export default class ProtomuxRPC extends EventEmitter { onmessage: this._onresponse.bind(this), }); - this._channel.open(options?.handshake); - - await this._channel.ready; + await this._channel.open(options?.handshake); } _onopen(handshake: any) {