From e543208af687a90e1f226f732a58fb325cc0902e Mon Sep 17 00:00:00 2001 From: Viktor Ahlqvist Date: Tue, 25 Jun 2019 11:42:05 +0200 Subject: [PATCH] Code example in README updated to 1.1.0 namespace. Updated the code example in the README file so that it uses `Paho.Client` rather than `Paho.MQTT.Client` so that it works in 1.1.0. Signed-off-by: Viktor Ahlqvist --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bd3ddcd..c44334a 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ This requires the use of a broker that supports WebSockets natively, or the use ```JS // Create a client instance -var client = new Paho.MQTT.Client(location.hostname, Number(location.port), "clientId"); +var client = new Paho.Client(location.hostname, Number(location.port), "clientId"); // set callback handlers client.onConnectionLost = onConnectionLost; @@ -90,7 +90,7 @@ function onConnect() { // Once a connection has been made, make a subscription and send a message. console.log("onConnect"); client.subscribe("World"); - message = new Paho.MQTT.Message("Hello"); + message = new Paho.Message("Hello"); message.destinationName = "World"; client.send(message); } @@ -110,5 +110,5 @@ function onMessageArrived(message) { ## Breaking Changes -Previously the Client's Namepsace was `Paho.MQTT`, as of version 1.1.0 (develop branch) this has now been simplified to `Paho`. +Previously the Client's Namepsace was `Paho.MQTT`, as of version 1.1.0 this has now been simplified to `Paho`. You should be able to simply do a find and replace in your code to resolve this, for example all instances of `Paho.MQTT.Client` will now be `Paho.Client` and `Paho.MQTT.Message` will be `Paho.Message`.