mirror of
https://github.com/nasa/openmct.git
synced 2025-06-17 06:38:17 +00:00
[Code Style] Use prototypes in telemetry bundle
WTD-1482
This commit is contained in:
@ -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;
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user