wrapInTimeout | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Function wrapInTimeout

    • Wrap a promise in a timeout

      Type Parameters

      • T

      Parameters

      • promise: Promise<T>

        Promise to wrap

      • timeout: WaitPeriod

        Timeout in milliseconds or as a Date

      • rejectWith: string | Error | (() => string | Error)

        Error to reject with if the timeout expires (string, Error, or a callback returning one)

      Returns Promise<T>