Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Thenable<T>

Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise, and others. This API makes no assumption about what promise libary is being used which enables reusing existing code without migrating to a specific promise implementation. Still, we recommend the use of native promises which are available in VS Code.

Type parameters

  • T

Hierarchy

  • Thenable

Index

Methods

Methods

then

  • then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>
  • then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>
  • Attaches callbacks for the resolution and/or rejection of the Promise.

    Type parameters

    • TResult

    Parameters

    • Optional onfulfilled: (value: T) => TResult | Thenable<TResult>

      The callback to execute when the Promise is resolved.

        • (value: T): TResult | Thenable<TResult>
        • Parameters

          • value: T

          Returns TResult | Thenable<TResult>

    • Optional onrejected: (reason: any) => TResult | Thenable<TResult>

      The callback to execute when the Promise is rejected.

        • (reason: any): TResult | Thenable<TResult>
        • Parameters

          • reason: any

          Returns TResult | Thenable<TResult>

    Returns Thenable<TResult>

    A Promise for the completion of which ever callback is executed.

  • Type parameters

    • TResult

    Parameters

    • Optional onfulfilled: (value: T) => TResult | Thenable<TResult>
        • (value: T): TResult | Thenable<TResult>
        • Parameters

          • value: T

          Returns TResult | Thenable<TResult>

    • Optional onrejected: (reason: any) => void
        • (reason: any): void
        • Parameters

          • reason: any

          Returns void

    Returns Thenable<TResult>

Generated using TypeDoc