Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

allSkipRejected

  • allSkipRejected<R>(values: Thenable<Thenable<R>[]>, logErrors?: boolean): Promise<R[]>
  • allSkipRejected<R>(values: Thenable<R[]>, logErrors?: boolean): Promise<R[]>
  • allSkipRejected<R>(values: Thenable<R>[], logErrors?: boolean): Promise<R[]>
  • allSkipRejected<R>(values: R[], logErrors?: boolean): Promise<R[]>
  • Similar to Promise.all(), except that any rejected promises are skipped, rather than causing the entire promise to be rejected. As a result, the returned array might contain less elements than the original.

    Type parameters

    • R

    Parameters

    Returns Promise<R[]>

  • Type parameters

    • R

    Parameters

    • values: Thenable<R[]>
    • Optional logErrors: boolean

    Returns Promise<R[]>

  • Type parameters

    • R

    Parameters

    • values: Thenable<R>[]
    • Optional logErrors: boolean

    Returns Promise<R[]>

  • Type parameters

    • R

    Parameters

    • values: R[]
    • Optional logErrors: boolean

    Returns Promise<R[]>

mapSkipRejected

  • mapSkipRejected<R, U>(values: Thenable<Thenable<R>[]>, mapper: function, option?: object, logErrors?: boolean): Promise<U[]>
  • mapSkipRejected<R, U>(values: Thenable<Thenable<R>[]>, mapper: function, option?: object, logErrors?: boolean): Promise<U[]>
  • mapSkipRejected<R, U>(values: Thenable<R[]>, mapper: function, option?: object, logErrors?: boolean): Promise<U[]>
  • mapSkipRejected<R, U>(values: Thenable<R[]>, mapper: function, option?: object, logErrors?: boolean): Promise<U[]>
  • mapSkipRejected<R, U>(values: Thenable<R>[], mapper: function, option?: object, logErrors?: boolean): Promise<U[]>
  • mapSkipRejected<R, U>(values: Thenable<R>[], mapper: function, option?: object, logErrors?: boolean): Promise<U[]>
  • mapSkipRejected<R, U>(values: R[], mapper: function, option?: object, logErrors?: boolean): Promise<U[]>
  • mapSkipRejected<R, U>(values: R[], mapper: function, option?: object, logErrors?: boolean): Promise<U[]>
  • Similar to Promise.map(), except that any rejected promises are skipped, rather than causing the entire promise to be rejected. As a result, the returned array might contain less elements than the original.

    Type parameters

    • R

    • U

    Parameters

    • values: Thenable<Thenable<R>[]>
    • mapper: function
        • (item: R, index: number, arrayLength: number): Thenable<U>
        • Parameters

          • item: R
          • index: number
          • arrayLength: number

          Returns Thenable<U>

    • Optional option: object
      • concurrency: number
    • Optional logErrors: boolean

    Returns Promise<U[]>

  • Type parameters

    • R

    • U

    Parameters

    • values: Thenable<Thenable<R>[]>
    • mapper: function
        • (item: R, index: number, arrayLength: number): U
        • Parameters

          • item: R
          • index: number
          • arrayLength: number

          Returns U

    • Optional option: object
      • concurrency: number
    • Optional logErrors: boolean

    Returns Promise<U[]>

  • Type parameters

    • R

    • U

    Parameters

    • values: Thenable<R[]>
    • mapper: function
        • (item: R, index: number, arrayLength: number): Thenable<U>
        • Parameters

          • item: R
          • index: number
          • arrayLength: number

          Returns Thenable<U>

    • Optional option: object
      • concurrency: number
    • Optional logErrors: boolean

    Returns Promise<U[]>

  • Type parameters

    • R

    • U

    Parameters

    • values: Thenable<R[]>
    • mapper: function
        • (item: R, index: number, arrayLength: number): U
        • Parameters

          • item: R
          • index: number
          • arrayLength: number

          Returns U

    • Optional option: object
      • concurrency: number
    • Optional logErrors: boolean

    Returns Promise<U[]>

  • Type parameters

    • R

    • U

    Parameters

    • values: Thenable<R>[]
    • mapper: function
        • (item: R, index: number, arrayLength: number): Thenable<U>
        • Parameters

          • item: R
          • index: number
          • arrayLength: number

          Returns Thenable<U>

    • Optional option: object
      • concurrency: number
    • Optional logErrors: boolean

    Returns Promise<U[]>

  • Type parameters

    • R

    • U

    Parameters

    • values: Thenable<R>[]
    • mapper: function
        • (item: R, index: number, arrayLength: number): U
        • Parameters

          • item: R
          • index: number
          • arrayLength: number

          Returns U

    • Optional option: object
      • concurrency: number
    • Optional logErrors: boolean

    Returns Promise<U[]>

  • Type parameters

    • R

    • U

    Parameters

    • values: R[]
    • mapper: function
        • (item: R, index: number, arrayLength: number): Thenable<U>
        • Parameters

          • item: R
          • index: number
          • arrayLength: number

          Returns Thenable<U>

    • Optional option: object
      • concurrency: number
    • Optional logErrors: boolean

    Returns Promise<U[]>

  • Type parameters

    • R

    • U

    Parameters

    • values: R[]
    • mapper: function
        • (item: R, index: number, arrayLength: number): U
        • Parameters

          • item: R
          • index: number
          • arrayLength: number

          Returns U

    • Optional option: object
      • concurrency: number
    • Optional logErrors: boolean

    Returns Promise<U[]>

propsSkipRejected

  • propsSkipRejected(object: Thenable<object>): Promise<object>
  • propsSkipRejected(object: object): Promise<object>
  • Similar to Promise.props(), except that any rejected promises are skipped, rather than causing the entire promise to be rejected. As a result, the returned object might contain less properties than the original.

    Parameters

    Returns Promise<object>

  • Parameters

    • object: object

    Returns Promise<object>

raceAll

  • raceAll<T>(promises: Promise<T>[], timeoutTime: number, timeoutValue: T): Promise<T[]>
  • Promise.all with a timeout and automatic resolution to a default value. If any of the promises do not resolve within 'timeoutTime' the 'timeoutValue' will be returned instead of waiting further. Note that any rejected promises will also be converted to 'timeoutValue' by this method, so if you want to handle errors attach a catch to the promise before passing it in here.

    Type parameters

    • T

    Parameters

    • promises: Promise<T>[]

      An array of promises

    • timeoutTime: number

      The amount of time to wait for resolution

    • timeoutValue: T

      The value to use for promises that time out.

    Returns Promise<T[]>

warnOnReject

  • Logs a warning if the given promise is rejected.

    Type parameters

    • T

    Parameters

    • promise: Thenable<T>

      The promise that might be rejected.

    • app: ViewerApplication

      The application

    • warning: string

      The warning text to log. May contain a "{0}" placeholder that will be substituted with the actual error.

    Returns Promise<T>