[Code Style] Use prototypes in telemetry bundle

WTD-1482
This commit is contained in:
Victor Woeltjen
2015-08-14 16:47:20 -07:00
parent 1ea6f7620e
commit 2ccca016a5
9 changed files with 443 additions and 461 deletions

View File

@ -44,39 +44,36 @@ define(
* @param $timeout Angular's $timeout
*/
function TelemetrySubscriber($q, $timeout) {
return {
/**
* Subscribe to streaming telemetry updates
* associated with this domain object (either
* directly or via capability delegation.)
*
* @param {DomainObject} domainObject the object whose
* associated telemetry data is of interest
* @param {Function} callback a function to invoke
* when new data has become available.
* @param {boolean} lossless flag to indicate whether the
* callback should be notified for all values
* (otherwise, multiple values in quick succession
* will call back with only the latest value.)
* @returns {TelemetrySubscription} the subscription,
* which will provide access to latest values.
*
* @method
* @memberof TelemetrySubscriber
* @memberof platform/telemetry.TelemetrySubscriber#
*/
subscribe: function (domainObject, callback, lossless) {
return new TelemetrySubscription(
$q,
$timeout,
domainObject,
callback,
lossless
);
}
};
this.$q = $q;
this.$timeout = $timeout;
}
/**
* Subscribe to streaming telemetry updates
* associated with this domain object (either
* directly or via capability delegation.)
*
* @param {DomainObject} domainObject the object whose
* associated telemetry data is of interest
* @param {Function} callback a function to invoke
* when new data has become available.
* @param {boolean} lossless flag to indicate whether the
* callback should be notified for all values
* (otherwise, multiple values in quick succession
* will call back with only the latest value.)
* @returns {platform/telemetry.TelemetrySubscription} the
* subscription, which will provide access to latest values.
*/
TelemetrySubscriber.prototype.subscribe = function (domainObject, callback, lossless) {
return new TelemetrySubscription(
this.$q,
this.$timeout,
domainObject,
callback,
lossless
);
};
return TelemetrySubscriber;
}
);