We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5dfe8f6 + 8f9deb5 commit f58ad37Copy full SHA for f58ad37
src/index.js
@@ -199,6 +199,21 @@ const disconnect = id => new Promise((resolve, reject) => {
199
}
200
201
client.disconnect();
202
+
203
+ // Remove property callbacks to allow resubscribing in a later connect()
204
+ Object.keys(propertyCallback).forEach((topic) => {
205
+ if (propertyCallback[topic]) {
206
+ delete propertyCallback[topic];
207
+ }
208
+ });
209
210
+ // Clean up subscribed topics - a new connection might not need the same topics
211
+ Object.keys(subscribedTopics).forEach((topic) => {
212
+ if (subscribedTopics[topic]) {
213
+ delete subscribedTopics[topic];
214
215
216
217
return resolve();
218
});
219
0 commit comments