mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-19 14:22:19 +01:00
debt - simplify stuff
This commit is contained in:
@@ -41,7 +41,13 @@ export function combinedDisposable(disposables: IDisposable[]): IDisposable {
|
||||
}
|
||||
|
||||
export function toDisposable(...fns: (() => void)[]): IDisposable {
|
||||
return combinedDisposable(fns.map(fn => ({ dispose: fn })));
|
||||
return {
|
||||
dispose() {
|
||||
for (const fn of fns) {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export abstract class Disposable implements IDisposable {
|
||||
|
||||
Reference in New Issue
Block a user