From 5152583c3ba6d589366f1556c6974409e58fbbd5 Mon Sep 17 00:00:00 2001 From: "Mazzella, Jesse D. (ARC-TI)[KBR Wyle Services, LLC]" Date: Fri, 19 May 2023 15:44:24 -0700 Subject: [PATCH] feat: `getAnnotations` can take an `abortSignal` --- src/api/annotation/AnnotationAPI.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/annotation/AnnotationAPI.js b/src/api/annotation/AnnotationAPI.js index 72f3d74d95..bb46a805e0 100644 --- a/src/api/annotation/AnnotationAPI.js +++ b/src/api/annotation/AnnotationAPI.js @@ -246,15 +246,16 @@ export default class AnnotationAPI extends EventEmitter { /** * @method getAnnotations * @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 */ - async getAnnotations(domainObjectIdentifier) { + async getAnnotations(domainObjectIdentifier, abortSignal = null) { const keyStringQuery = this.openmct.objects.makeKeyString(domainObjectIdentifier); const searchResults = ( await Promise.all( this.openmct.objects.search( keyStringQuery, - null, + abortSignal, this.openmct.objects.SEARCH_TYPES.ANNOTATIONS ) )