Skip to content

Commit

Permalink
👯‍♂️ remove wireCancellationToken #56137
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Sep 7, 2018
1 parent 8f29268 commit cd87374
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/vs/base/common/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,6 @@ export function asThenable<T>(callback: () => T | TPromise<T> | Thenable<T>): Th
}, () => { /* not supported */ });
}

/**
* Hook a cancellation token to a WinJS Promise
*/
export function wireCancellationToken<T>(token: CancellationToken, promise: TPromise<T>, resolveAsUndefinedWhenCancelled?: boolean): Thenable<T> {
const subscription = token.onCancellationRequested(() => promise.cancel());
if (resolveAsUndefinedWhenCancelled) {
promise = promise.then<T>(undefined, err => {
if (!errors.isPromiseCanceledError(err)) {
return TPromise.wrapError(err);
}
return undefined;
});
}
return always(promise, () => subscription.dispose());
}

export interface ITask<T> {
(): T;
}
Expand Down

0 comments on commit cd87374

Please sign in to comment.