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

  • PromiseLike<T>
    • Thenable

Index

Methods(1)

Methods(1)

then

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

    Type parameters

    • TResult1 = T

    • TResult2 = never

    Parameters

    • Optional onfulfilled: null | ((value: T) => TResult1 | PromiseLike<TResult1>)

      The callback to execute when the Promise is resolved.

    • Optional onrejected: null | ((reason: any) => TResult2 | PromiseLike<TResult2>)

      The callback to execute when the Promise is rejected.

    Returns PromiseLike<TResult1 | TResult2>

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

Generated by TypeDoc. Maintained by 紫升

Links: 搜外友链, 69中文网