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 library 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 this editor.

Type Parameters

  • T

Hierarchy

  • Thenable

Index

Methods

Methods

  • 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.

        • 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>)
        • Parameters

          • value: T

          Returns TResult | Thenable<TResult>

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

          • reason: any

          Returns void

    Returns Thenable<TResult>