You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tutorial telemetry provider implementation supports only one subscriber per key. Later subscriptions overwrite the listener. Each key should have an array of listeners instead.
While the implementation works for the exact tutorial use case, it breaks if you add additional graphs. The tutorial may also used as a basis for further development, so it can be a source of much confusion.
A proper implementation would be for example:
subscribe: function (domainObject, callback) {
var key = domainObject.identifier.key
listener[key] = listener[key] || []
listener[key].push(callback);
return function unsubscribe() {
var index = listener[key].indexOf(callback);
if (index > -1) {
listener[key].splice(index, 1);
}
};
}
Correspondingly calling the listeners:
listener[key].forEach(function(l) { l(point) });
The text was updated successfully, but these errors were encountered:
The tutorial telemetry provider implementation supports only one subscriber per key. Later subscriptions overwrite the listener. Each key should have an array of listeners instead.
While the implementation works for the exact tutorial use case, it breaks if you add additional graphs. The tutorial may also used as a basis for further development, so it can be a source of much confusion.
A proper implementation would be for example:
Correspondingly calling the listeners:
The text was updated successfully, but these errors were encountered: