From 800825bf619d83ef713a5b2fa1533bbf6ccac872 Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Wed, 28 Jun 2023 17:33:59 +0200 Subject: [PATCH] fix: consistency, used `this` instead of `that` (#1618) --- lib/client.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/client.js b/lib/client.js index b1a3fd032..d02c16f47 100644 --- a/lib/client.js +++ b/lib/client.js @@ -330,7 +330,7 @@ function MqttClient (streamBuilder, options) { // Send queued packets this.on('connect', function () { - const queue = this.queue + const queue = that.queue function deliver () { const entry = queue.shift() @@ -372,10 +372,10 @@ function MqttClient (streamBuilder, options) { this.on('close', function () { debug('close :: connected set to `false`') - this.connected = false + that.connected = false debug('close :: clearing connackTimer') - clearTimeout(this.connackTimer) + clearTimeout(that.connackTimer) debug('close :: clearing ping timer') if (that.pingTimer !== null) { @@ -383,12 +383,12 @@ function MqttClient (streamBuilder, options) { that.pingTimer = null } - if (this.topicAliasRecv) { - this.topicAliasRecv.clear() + if (that.topicAliasRecv) { + that.topicAliasRecv.clear() } debug('close :: calling _setupReconnect') - this._setupReconnect() + that._setupReconnect() }) EventEmitter.call(this)