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

层级

  • Thenable

索引

Methods(1)

Methods(1)

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>

VS Code 插件开发中文文档 | VS Code 中文文档 | VS Code 官网文档 | VS Code 扩展市场

Generated by TypeDoc