提交 75f5ea25 编写于 作者: J Johannes Rieken

debt - asThenable returns a native promise

上级 61a2faf7
......@@ -58,8 +58,8 @@ export function createCancelablePromise<T>(callback: (token: CancellationToken)
};
}
export function asThenable<T>(callback: () => T | TPromise<T> | Thenable<T>): Thenable<T> {
return new TPromise<T>((resolve, reject) => {
export function asThenable<T>(callback: () => T | Thenable<T>): Promise<T> {
return new Promise<T>((resolve, reject) => {
let item = callback();
if (item instanceof TPromise) {
item.then(resolve, reject);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册