CancelablePromise
Type Parameters
• T
Implements
Promise
<T
>
Constructors
new CancelablePromise()
new CancelablePromise<
T
>(executor
):CancelablePromise
<T
>
Parameters
• executor
Returns
Defined in
packages/core/src/CancelablePromise.ts:29
Properties
cancelHandlers
readonly
cancelHandlers: () =>void
[]
Defined in
packages/core/src/CancelablePromise.ts:24
promise
readonly
promise:Promise
<T
>
Defined in
packages/core/src/CancelablePromise.ts:25
Accessors
[toStringTag]
get
[toStringTag]():string
Returns
string
Implementation of
Promise.[toStringTag]
Defined in
packages/core/src/CancelablePromise.ts:83
isCancelled
get
isCancelled():boolean
Returns
boolean
Defined in
packages/core/src/CancelablePromise.ts:123
Methods
cancel()
cancel():
void
Returns
void
Defined in
packages/core/src/CancelablePromise.ts:104
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
Defined in
packages/core/src/CancelablePromise.ts:94
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
Defined in
packages/core/src/CancelablePromise.ts:100
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