Class PromiseState
public
Defined in:
../ember/src/index.ts:50
Module:
@warp-drive/ember
PromiseState provides a reactive wrapper for a promise which allows you write declarative code around a promise's control flow. It is useful in both Template and JavaScript contexts, allowing you to quickly derive behaviors and data from pending, error and success states.
interface PromiseState<T = unknown, E = unknown> {
isPending: boolean;
isSuccess: boolean;
isError: boolean;
result: T | null;
error: E | null;
}
To get the state of a promise, use getPromiseState
.