Properties
promise
promise: Promise<T> = ...
reject
reject: ((err?: unknown) => void)
resolve
resolve: ((value: T | PromiseLike<T>) => void)
Type declaration
- (value: T | PromiseLike<T>): void
Parameters
value: T | PromiseLike<T>
Returns void
state
state: "resolved" | "rejected" | "unresolved" = 'unresolved'
Simple implementation of the deferred pattern. An object that exposes a promise and functions to resolve and reject it.