@reactoo/watchtogether-sdk-js 2.7.87 → 2.7.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/models/iot.js
CHANGED
|
@@ -255,6 +255,10 @@ let iot = function () {
|
|
|
255
255
|
return this.iot.__promise.then(() => this.__privates.iot.send(topic,message));
|
|
256
256
|
},
|
|
257
257
|
|
|
258
|
+
emitMessage: (message) => {
|
|
259
|
+
this.__privates.iot.emitMessage(message);
|
|
260
|
+
},
|
|
261
|
+
|
|
258
262
|
$once: (key, callback, that) => {
|
|
259
263
|
return this.__privates.iot.once(key, callback, that || this);
|
|
260
264
|
},
|
package/src/modules/wt-iot2.js
CHANGED
|
@@ -232,6 +232,10 @@ class Iot {
|
|
|
232
232
|
this.worker?.postMessage({ type: 'send', topic, message: msg });
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
emitMessage(message) {
|
|
236
|
+
this.emit('message', message)
|
|
237
|
+
}
|
|
238
|
+
|
|
235
239
|
handleWorkerMessage(event) {
|
|
236
240
|
const { type, data, connectionId } = event.data;
|
|
237
241
|
switch (type) {
|