Type parameters

  • T

Hierarchy

  • Thenable

Index

Methods

Methods

then

  • then<TResult>(onfulfilled?: function, onrejected?: function): Thenable<TResult>
  • then<TResult>(onfulfilled?: function, onrejected?: function): Thenable<TResult>
  • Attaches callbacks for the resolution and/or rejection of the Promise.

    Type parameters

    • TResult

    Parameters

    • Optional onfulfilled: function

      The callback to execute when the Promise is resolved.

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

          • value: T

          Returns TResult | Thenable<TResult>

    • Optional onrejected: function

      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: function
        • (value: T): TResult | Thenable<TResult>
        • Parameters

          • value: T

          Returns TResult | Thenable<TResult>

    • Optional onrejected: function
        • (reason: any): void
        • Parameters

          • reason: any

          Returns void

    Returns Thenable<TResult>