From df7765eb552d0d52b26166ea5f44163bdcd74b36 Mon Sep 17 00:00:00 2001 From: Nikos Epping Date: Thu, 15 Aug 2024 14:09:03 +0200 Subject: [PATCH] Pass client in beforeConnect --- src/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.ts b/src/client.ts index d567d20..04ca624 100644 --- a/src/client.ts +++ b/src/client.ts @@ -221,7 +221,7 @@ export class Client { * This can be used to reliably fetch credentials, access token etc. from some other service * in an asynchronous way. */ - public beforeConnect: () => void | Promise; + public beforeConnect: (client: Client) => void | Promise; /** * Callback, invoked on every successful connection to the STOMP broker. @@ -408,7 +408,7 @@ export class Client { } private async _connect(): Promise { - await this.beforeConnect(); + await this.beforeConnect(this); if (this._stompHandler) { this.debug('There is already a stompHandler, skipping the call to connect');