Promise

open external class Promise<out T>(executor: (resolve: (T) -> Unit, reject: (Throwable) -> Unit) -> Unit)(source)

Exposes the JavaScript Promise object to Kotlin.

Since Kotlin

1.1

Constructors

Link copied to clipboard
constructor(executor: (resolve: (T) -> Unit, reject: (Throwable) -> Unit) -> Unit)

Types

Link copied to clipboard
object Companion
Since Kotlin 1.1

Functions

Link copied to clipboard
open fun <S> catch(onRejected: (Throwable) -> S): Promise<S>
Since Kotlin 1.1
Link copied to clipboard
open fun finally(onFinally: () -> Unit): Promise<T>
Since Kotlin 1.1
Link copied to clipboard
open fun <S> then(onFulfilled: (T) -> S?): Promise<S>
open fun <S> then(onFulfilled: (T) -> S?, onRejected: (Throwable) -> S?): Promise<S>
Since Kotlin 1.1
Link copied to clipboard
inline fun <T, S> Promise<Promise<T>>.then(noinline onFulfilled: (T) -> S?): Promise<S>
inline fun <T, S> Promise<Promise<T>>.then(noinline onFulfilled: (T) -> S?, noinline onRejected: (Throwable) -> S?): Promise<S>
Since Kotlin 1.1