This commit is contained in:
Johannes Rieken 2018-08-16 17:35:56 +02:00
parent 4390abed32
commit eddf13fd7a

View file

@ -8,6 +8,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
import { once as onceFn } from 'vs/base/common/functional';
import { combinedDisposable, Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { LinkedList } from 'vs/base/common/linkedList';
import { TPromise } from 'vs/base/common/winjs.base';
/**
* To an event a function with one or zero parameters
@ -294,8 +295,8 @@ export function fromPromise<T =any>(promise: Thenable<T>): Event<T> {
return emitter.event;
}
export function toPromise<T>(event: Event<T>): Promise<T> {
return new Promise(complete => {
export function toPromise<T>(event: Event<T>): Thenable<T> {
return new TPromise(complete => {
const sub = event(e => {
sub.dispose();
complete(e);