diff --git a/packages/mqtt/mqtt.mjs b/packages/mqtt/mqtt.mjs index 67bce6b02..aa8a4427f 100644 --- a/packages/mqtt/mqtt.mjs +++ b/packages/mqtt/mqtt.mjs @@ -57,6 +57,7 @@ Pattern.prototype.mqtt = function ( cx = connections[key]; } else { cx = new Paho.Client(host, client); + connections[key] = cx; cx.onConnectionLost = onConnectionLost; cx.onMessageArrived = onMessageArrived; const props = {