langchain.js
    Preparing search index...
    • Race a promise with an abort signal. If the signal is aborted, the promise will be rejected with the error from the signal. If the promise is rejected, the signal will be aborted.

      Type Parameters

      • T

      Parameters

      • promise: Promise<T>

        The promise to race.

      • Optionalsignal: AbortSignal

        The abort signal.

      Returns Promise<T>

      The result of the promise.