Task <I, O>
Hierarchy
- Deferred<O>
- Task
Index
Constructors
publicconstructor
Type parameters
- I
- O
Parameters
input: I
Returns Task<I, O>
Accessors
public[toStringTag]
Returns string
publicinput
Returns I
state
Returns DeferredState
Methods
catch
Attaches a callback for only the rejection of the Promise.
Type parameters
- TResult = never
Parameters
optionalonrejected: null | (reason: unknown) => TResult | PromiseLike<TResult>
The callback to execute when the Promise is rejected.
Returns Promise<O | TResult>
A Promise for the completion of the callback.
finally
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
Parameters
optionalonfinally: null | () => void
The callback to execute when the Promise is settled (fulfilled or rejected).
Returns Promise<O>
A Promise for the completion of the callback.
reject
Rejects the promise with a reason.
Parameters
optionalreason: any
The reason why the promise was rejected.
Returns void
resolve
Resolves the promise with a value or the result of another promise.
Parameters
value: O | PromiseLike<O>
The value to resolve the promise with.
Returns void
then
Attaches callbacks for the resolution and/or rejection of the Promise.
Type parameters
- TResult1 = O
- TResult2 = never
Parameters
optionalonfulfilled: null | (value: O) => TResult1 | PromiseLike<TResult1>
The callback to execute when the Promise is resolved.
optionalonrejected: null | (reason: unknown) => TResult2 | PromiseLike<TResult2>
The callback to execute when the Promise is rejected.
Returns Promise<TResult1 | TResult2>
A Promise for the completion of which ever callback is executed.
Gets the current state of the deferred promise.
DeferredState