From 7d12c2ba54a34fb837f620ae76ba46bd25cff03d Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 16 Nov 2021 14:09:37 +0530 Subject: [PATCH] Add return types --- src/utils/Disposables.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/Disposables.ts b/src/utils/Disposables.ts index e05b1e87..dc538c99 100644 --- a/src/utils/Disposables.ts +++ b/src/utils/Disposables.ts @@ -26,7 +26,6 @@ function disposeValue(value: Disposable): void { } function isDisposable(value: Disposable): boolean { - // todo: value can be undefined I think? return value && (typeof value === "function" || typeof value.dispose === "function"); } @@ -46,10 +45,10 @@ export class Disposables { return disposable; } - untrack(disposable: Disposable) { + untrack(disposable: Disposable): null { if (this.isDisposed) { console.warn("Disposables already disposed, cannot untrack"); - return; + return null; } const idx = this._disposables!.indexOf(disposable); if (idx >= 0) {