• Call a function with abort signal and clear the memory.

    Some functions do not clear a signal listener after successful execution. By wrapping the original AbortSignal (which may be long-lived) in a temporary AbortSignal that we can throw out when fn completes, we make sure a function we call does not leave stuff in memory.

    Type Parameters

    • T

    Parameters

    • original: AbortSignal

      Original AbortSignal.

    • fn: ((abortSignal: AbortSignal) => Promise<T>)

      Function that uses an AbortSignal.

        • (abortSignal: AbortSignal): Promise<T>
        • Parameters

          • abortSignal: AbortSignal

          Returns Promise<T>

    Returns Promise<T>