mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 08:39:59 +00:00
[API] Only use strategy where needed
Satisfies JSHint.
This commit is contained in:
@ -201,9 +201,7 @@ define([
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
TelemetryAPI.prototype.findProvider = function (domainObject, options) {
|
TelemetryAPI.prototype.findProvider = function (domainObject, strategy) {
|
||||||
var strategy = options.strategy;
|
|
||||||
|
|
||||||
function supportsDomainObject(provider) {
|
function supportsDomainObject(provider) {
|
||||||
return provider.canProvideTelemetry(domainObject);
|
return provider.canProvideTelemetry(domainObject);
|
||||||
}
|
}
|
||||||
@ -236,7 +234,7 @@ define([
|
|||||||
* telemetry data
|
* telemetry data
|
||||||
*/
|
*/
|
||||||
TelemetryAPI.prototype.request = function (domainObject, options) {
|
TelemetryAPI.prototype.request = function (domainObject, options) {
|
||||||
var provider = this.findProvider(domainObject, options);
|
var provider = this.findProvider(domainObject, options.strategy);
|
||||||
return provider ?
|
return provider ?
|
||||||
provider.request(domainObject, options) :
|
provider.request(domainObject, options) :
|
||||||
Promise.reject([]);
|
Promise.reject([]);
|
||||||
@ -310,7 +308,7 @@ define([
|
|||||||
limitEvaluator: undefined
|
limitEvaluator: undefined
|
||||||
}, function (defaultValue, method) {
|
}, function (defaultValue, method) {
|
||||||
TelemetryAPI.prototype[method] = function (domainObject) {
|
TelemetryAPI.prototype[method] = function (domainObject) {
|
||||||
var provider = this.findProvider(domainObject, options);
|
var provider = this.findProvider(domainObject);
|
||||||
return provider ?
|
return provider ?
|
||||||
provider[method].apply(provider, arguments) :
|
provider[method].apply(provider, arguments) :
|
||||||
defaultValue;
|
defaultValue;
|
||||||
|
Reference in New Issue
Block a user