Function createNativeRejectedPromise

Returns a single asynchronous Promise instance that is already rejected with the given reason. Any chained operations will execute asynchronously using the optional timeout value to schedule when then chained items will be executed. (eg. catch(); finally()).

  • Type Parameters

    • T = unknown

    Parameters

    • reason: any

      The rejection reason

    • Optionaltimeout: number

      Optional timeout to wait before processing the items, defaults to zero.

    Returns Promise<T>