mirror of
https://github.com/nasa/openmct.git
synced 2025-03-12 07:24:13 +00:00
feat: getAnnotations
can take an abortSignal
This commit is contained in:
parent
4cab97cb4b
commit
5152583c3b
@ -246,15 +246,16 @@ export default class AnnotationAPI extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* @method getAnnotations
|
* @method getAnnotations
|
||||||
* @param {Identifier} domainObjectIdentifier - The domain object identifier to use to search for annotations. For example, a telemetry object identifier.
|
* @param {Identifier} domainObjectIdentifier - The domain object identifier to use to search for annotations. For example, a telemetry object identifier.
|
||||||
|
* @param {AbortSignal} abortSignal - An abort signal to cancel the search
|
||||||
* @returns {DomainObject[]} Returns an array of annotations that match the search query
|
* @returns {DomainObject[]} Returns an array of annotations that match the search query
|
||||||
*/
|
*/
|
||||||
async getAnnotations(domainObjectIdentifier) {
|
async getAnnotations(domainObjectIdentifier, abortSignal = null) {
|
||||||
const keyStringQuery = this.openmct.objects.makeKeyString(domainObjectIdentifier);
|
const keyStringQuery = this.openmct.objects.makeKeyString(domainObjectIdentifier);
|
||||||
const searchResults = (
|
const searchResults = (
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
this.openmct.objects.search(
|
this.openmct.objects.search(
|
||||||
keyStringQuery,
|
keyStringQuery,
|
||||||
null,
|
abortSignal,
|
||||||
this.openmct.objects.SEARCH_TYPES.ANNOTATIONS
|
this.openmct.objects.SEARCH_TYPES.ANNOTATIONS
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user