Add return types

This commit is contained in:
RMidhunSuresh 2021-11-16 14:09:37 +05:30
parent 7270918b65
commit 7d12c2ba54

View file

@ -26,7 +26,6 @@ function disposeValue(value: Disposable): void {
} }
function isDisposable(value: Disposable): boolean { function isDisposable(value: Disposable): boolean {
// todo: value can be undefined I think?
return value && (typeof value === "function" || typeof value.dispose === "function"); return value && (typeof value === "function" || typeof value.dispose === "function");
} }
@ -46,10 +45,10 @@ export class Disposables {
return disposable; return disposable;
} }
untrack(disposable: Disposable) { untrack(disposable: Disposable): null {
if (this.isDisposed) { if (this.isDisposed) {
console.warn("Disposables already disposed, cannot untrack"); console.warn("Disposables already disposed, cannot untrack");
return; return null;
} }
const idx = this._disposables!.indexOf(disposable); const idx = this._disposables!.indexOf(disposable);
if (idx >= 0) { if (idx >= 0) {