Skip to main content

CancelablePromise

@loginid/websdk3Docs


@loginid/websdk3 / Internal Modules / CancelablePromise

Class: CancelablePromise<T>

Type Parameters

T

Implements

  • Promise<T>

Constructors

new CancelablePromise()

new CancelablePromise<T>(executor): CancelablePromise<T>

Parameters

executor

Returns

CancelablePromise<T>

Accessors

[toStringTag]

get [toStringTag](): string

Returns

string

Implementation of

Promise.[toStringTag]


isCancelled

get isCancelled(): boolean

Returns

boolean

Methods

cancel()

cancel(): void

Returns

void


catch()

catch<TResult>(onRejected?): Promise<T | TResult>

Attaches a callback for only the rejection of the Promise.

Type Parameters

TResult = never

Parameters

onRejected?: null | (reason) => TResult | PromiseLike<TResult>

Returns

Promise<T | TResult>

A Promise for the completion of the callback.

Implementation of

Promise.catch


finally()

finally(onFinally?): Promise<T>

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

Parameters

onFinally?: null | () => void

Returns

Promise<T>

A Promise for the completion of the callback.

Implementation of

Promise.finally


then()

then<TResult1, TResult2>(onFulfilled?, onRejected?): Promise<TResult1 | TResult2>

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

Type Parameters

TResult1 = T

TResult2 = never

Parameters

onFulfilled?: null | (value) => TResult1 | PromiseLike<TResult1>

onRejected?: null | (reason) => TResult2 | PromiseLike<TResult2>

Returns

Promise<TResult1 | TResult2>

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

Implementation of

Promise.then