mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Add return types
This commit is contained in:
parent
7270918b65
commit
7d12c2ba54
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user