{"action":"created","issue":{"url":"https://api.github.com/repos/mqttjs/async-mqtt/issues/13","repository_url":"https://api.github.com/repos/mqttjs/async-mqtt","labels_url":"https://api.github.com/repos/mqttjs/async-mqtt/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/mqttjs/async-mqtt/issues/13/comments","events_url":"https://api.github.com/repos/mqttjs/async-mqtt/issues/13/events","html_url":"https://github.com/mqttjs/async-mqtt/issues/13","id":387637017,"node_id":"MDU6SXNzdWUzODc2MzcwMTc=","number":13,"title":"Connected status of client?","user":{"login":"chainhead","id":24602959,"node_id":"MDQ6VXNlcjI0NjAyOTU5","avatar_url":"https://avatars2.githubusercontent.com/u/24602959?v=4","gravatar_id":"","url":"https://api.github.com/users/chainhead","html_url":"https://github.com/chainhead","followers_url":"https://api.github.com/users/chainhead/followers","following_url":"https://api.github.com/users/chainhead/following{/other_user}","gists_url":"https://api.github.com/users/chainhead/gists{/gist_id}","starred_url":"https://api.github.com/users/chainhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chainhead/subscriptions","organizations_url":"https://api.github.com/users/chainhead/orgs","repos_url":"https://api.github.com/users/chainhead/repos","events_url":"https://api.github.com/users/chainhead/events{/privacy}","received_events_url":"https://api.github.com/users/chainhead/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-05T08:06:58Z","updated_at":"2018-12-05T14:35:43Z","closed_at":null,"author_association":"NONE","body":"How do I get the [connection status](https://github.com/mqttjs/MQTT.js#mqttclientconnected) of a client? The following returns `undefined`.\r\n\r\n```\r\nconst MQTT = require('async-mqtt')\r\nconst uuidv1 = require('uuid/v1')\r\n//\r\nvar client = MQTT.connect('tcp://localhost:1883', { clientId: uuidv1() })\r\nclient.on('connect', () => {\r\n    console.log(client.connected)\r\n})\r\nclient.on('reconnect', () => {\r\n    console.log('Reconnected.')\r\n})\r\nclient.on('close', () => {\r\n    console.log('Closed.')\r\n})\r\n```\r\n\r\nThis `client._client.connected` returns `true`, however."},"comment":{"url":"https://api.github.com/repos/mqttjs/async-mqtt/issues/comments/444506235","html_url":"https://github.com/mqttjs/async-mqtt/issues/13#issuecomment-444506235","issue_url":"https://api.github.com/repos/mqttjs/async-mqtt/issues/13","id":444506235,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDUwNjIzNQ==","user":{"login":"RangerMauve","id":911495,"node_id":"MDQ6VXNlcjkxMTQ5NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/911495?v=4","gravatar_id":"","url":"https://api.github.com/users/RangerMauve","html_url":"https://github.com/RangerMauve","followers_url":"https://api.github.com/users/RangerMauve/followers","following_url":"https://api.github.com/users/RangerMauve/following{/other_user}","gists_url":"https://api.github.com/users/RangerMauve/gists{/gist_id}","starred_url":"https://api.github.com/users/RangerMauve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RangerMauve/subscriptions","organizations_url":"https://api.github.com/users/RangerMauve/orgs","repos_url":"https://api.github.com/users/RangerMauve/repos","events_url":"https://api.github.com/users/RangerMauve/events{/privacy}","received_events_url":"https://api.github.com/users/RangerMauve/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T14:35:43Z","updated_at":"2018-12-05T14:35:43Z","author_association":"CONTRIBUTOR","body":"Snap! That's 100% a bug. I'll add something for it sometime soon.\r\n\r\nIn the meantime, a pr that extends from #11 would be very much welcome. We just need to add a new getter for the connected status and add a unit test to check for it."}}
{"actor":{"display_login":"RangerMauve"}}