{
PROMISE_PENDING: "pending",
PROMISE_RESOLVED: "resolved",
PROMISE_REJECTED: "rejected"
}
Presents all the possible promise statuses.
"pending"
Presents status name for pending
promise.
"resolved"
Presents status name for resolved
promise.
"rejected"
Presents status name for rejected
promise.
async promiseStatus(
promise: Promise
): string // PROMISE_PENDING | PROMISE_RESOLVED | PROMISE_REJECTED
Returns an actual status of the promise.
async promiseState(
promise: Promise
): {
status: string, // PROMISE_PENDING | PROMISE_RESOLVED | PROMISE_REJECTED
[value]: any,
[reason]: any
}
Describes actual state of the promise.
async isPromisePending(
promise: Promise
): boolean
Tells whether promise is in pending
status.
async isPromiseResolved(
promise: Promise
): boolean
Tells whether promise is in resolved
status.
async isPromiseRejected(
promise: Promise
): boolean
Tells whether promise is in rejected
status.
async isPromiseNotPending(
promise: Promise
): boolean
Tells whether promise is in any status different to pending
.
async isPromiseNotResolved(
promise: Promise
): boolean
Tells whether promise is in any status different to resolved
.
async isPromiseNotRejected(
promise: Promise
): boolean
Tells whether promise is in any status different to rejected
.