Interface IPromiseResult<T>

The result of a promise. It can either be fulfilled with a value, or rejected with a reason.

0.5.0

The type of the rejected reason.

const result: IPromiseResult<number> = {
status: "fulfilled",
value: 42
};

const result: IPromiseResult<number> = {
status: "rejected",
reason: "Hello Darkness"
};
interface IPromiseResult<T> {
    reason?: any;
    status: "fulfilled" | "rejected";
    value?: T;
}

Type Parameters

  • T

    The type of the fulfilled value.

Properties

Properties

reason?: any

The reason that the promise was rejected with.

status: "fulfilled" | "rejected"

A string indicating whether the promise was fulfilled or rejected

value?: T

The value that the promise was fulfilled with.