Returns {
promise: Promise<T>;
reject: ((reason?: any) => void);
resolve: ((value: T | PromiseLike<T>) => void);
}
An object including a promise and the methods to resolve or reject that promise.
promise: Promise<T>
reject: ((reason?: any) => void)
- (reason?): void
Returns void
resolve: ((value: T | PromiseLike<T>) => void)
- (value): void
Parameters
- value: T | PromiseLike<T>
Returns void
Easier than
new Promise()
.