VS Code API
    Preparing search index...

    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.

    interface Thenable<T> {
        then<TResult1 = T, TResult2 = never>(
            onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
            onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
        ): PromiseLike<TResult1 | TResult2>;
    }

    Type Parameters

    • T

    Hierarchy

    • PromiseLike<T>
      • Thenable
    Index

    Methods

    Methods

    • Attaches callbacks for the resolution and/or rejection of the Promise.

      Type Parameters

      • TResult1 = T
      • TResult2 = never

      Parameters

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

        The callback to execute when the Promise is resolved.

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

        The callback to execute when the Promise is rejected.

      Returns PromiseLike<TResult1 | TResult2>

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