From 57f45959c1e64b98991abd8ab5f0e9dae03040f7 Mon Sep 17 00:00:00 2001 From: dkdk225 <49940741+dkdk225@users.noreply.github.com> Date: Mon, 28 Aug 2023 12:12:10 +0300 Subject: [PATCH] docs(readme): specify the Client as an event emitter to improve understandability (#1679) --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2712d5335..68d7b9291 100644 --- a/README.md +++ b/README.md @@ -351,7 +351,8 @@ Async [`connect`](#connect). Returns a `Promise` that resolves to a `mqtt.Client The `Client` class wraps a client connection to an MQTT broker over an arbitrary transport method (TCP, TLS, -WebSocket, ecc). +WebSocket, ecc). +`Client` is an [EventEmitter](https://nodejs.dev/en/learn/the-nodejs-event-emitter/) that has it's own [events](#events) `Client` automatically handles the following: @@ -446,6 +447,8 @@ If you are connecting to a broker that supports only MQTT 3.1 (not This is confirmed on RabbitMQ 3.2.4, and on Mosquitto < 1.3. Mosquitto version 1.3 and 1.4 works fine without those. + + #### Event `'connect'` `function (connack) {}`