OpenPromise <T>
Implements
- Promise<T>
Index
Constructors
Properties
Methods
Constructors
constructor
Type parameters
- T
Parameters
executor: PromiseExecutor<T> = null
lazy: boolean = false
Returns OpenPromise<T>
Properties
readonly[toStringTag]
readonlycatch
Type declaration
Type parameters
- TResult = never
Parameters
optionalonrejected: (reason: any) => TResult | PromiseLike<TResult>
The callback to execute when the Promise is rejected.
Returns Promise<T | TResult>
A Promise for the completion of the callback.
readonlyexecutor
readonlyfinally
Type declaration
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: () => void
The callback to execute when the Promise is settled (fulfilled or rejected).
Returns Promise<T>
A Promise for the completion of the callback.
readonlylazy
readonlypromise
rejectedReason
resolvedValue
state
readonlythen
Type declaration
Attaches callbacks for the resolution and/or rejection of the Promise.
Type parameters
- TResult1 = T
- TResult2 = never
Parameters
optionalonfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>
The callback to execute when the Promise is resolved.
optionalonrejected: (reason: any) => 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.
Methods
execute
Returns void
reject
Parameters
reason: Error
Returns void
resolve
Parameters
value: T | PromiseLike<T>
Returns void
Attaches a callback for only the rejection of the Promise.