Skip to main content

PromiseLike

Type Parameters

Type Parameter
T

Methods

then()

then<TResult1, TResult2>(onfulfilled?, onrejected?): PromiseLike<TResult1 | TResult2>;

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

Type Parameters

Type ParameterDefault type
TResult1T
TResult2never

Parameters

ParameterTypeDescription
onfulfilled?((value) => TResult1 | PromiseLike<TResult1>) | nullThe callback to execute when the Promise is resolved.
onrejected?((reason) => TResult2 | PromiseLike<TResult2>) | nullThe callback to execute when the Promise is rejected.

Returns

PromiseLike<TResult1 | TResult2>

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