The methods of this interface are available when a Promise has been augmented using the trackState function.

interface StateQueryable {
    isCancelled(): boolean;
    isFulfilled(): boolean;
    isRejected(): boolean;
    isSettled(): boolean;
}

Methods

  • Returns true if the promise was cancelled before it was able to complete.

    Returns boolean

  • Returns true if the promise is fulfilled, i.e. if it has a success value.

    Returns boolean

  • Returns true if the promise is rejected, i.e. if it contains an error.

    Returns boolean

  • Returns true if the promise is settled, i.e. if it is no longer pending.

    Returns boolean