Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Future<T>

Type parameters

  • T

Hierarchy

  • Future

Index

Constructors

constructor

Properties

catchError

catchError: (onError: (error?: T) => void, props?: { test?: (error: T) => undefined | boolean }) => Future<T>

Type declaration

    • (onError: (error?: T) => void, props?: { test?: (error: T) => undefined | boolean }): Future<T>
    • Parameters

      • onError: (error?: T) => void
          • (error?: T): void
          • Parameters

            • Optional error: T

            Returns void

      • Optional props: { test?: (error: T) => undefined | boolean }
        • Optional test?: (error: T) => undefined | boolean
            • (error: T): undefined | boolean
            • Parameters

              • error: T

              Returns undefined | boolean

      Returns Future<T>

then

then: <R>(onValue: (value: T) => R, props?: { onError?: (err: any) => undefined | void }) => Future<R>

Type declaration

    • <R>(onValue: (value: T) => R, props?: { onError?: (err: any) => undefined | void }): Future<R>
    • Type parameters

      • R

      Parameters

      • onValue: (value: T) => R
          • (value: T): R
          • Parameters

            • value: T

            Returns R

      • Optional props: { onError?: (err: any) => undefined | void }
        • Optional onError?: (err: any) => undefined | void
            • (err: any): undefined | void
            • Parameters

              • err: any

              Returns undefined | void

      Returns Future<R>

whenComplete

whenComplete: (action: () => any) => Future<T>

Type declaration

    • (action: () => any): Future<T>
    • Parameters

      • action: () => any
          • (): any
          • Returns any

      Returns Future<T>

Methods

Static any

Static doWhile

Static error

  • error<T>(error: T, stackTrace?: any): Future<T>

Static forEach

  • forEach<T>(element: T[], action: (element: T) => any): Future<any>
  • Type parameters

    • T

    Parameters

    • element: T[]
    • action: (element: T) => any
        • (element: T): any
        • Parameters

          • element: T

          Returns any

    Returns Future<any>

Static sync

Static value

Static wait

  • wait<T>(futures: Future<T>[], __namedParameters: { cleanUp: (successValue: T) => void; eagerError: boolean }): Future<T[]>
  • Type parameters

    • T

    Parameters

    • futures: Future<T>[]
    • __namedParameters: { cleanUp: (successValue: T) => void; eagerError: boolean }
      • cleanUp: (successValue: T) => void
          • (successValue: T): void
          • Parameters

            • successValue: T

            Returns void

      • eagerError: boolean

    Returns Future<T[]>

Generated using TypeDoc