Merge pull request #17943 from umbraco/v15/feature/no-callback-then-destroy

Feature: no callback then destroy
This commit is contained in:
Niels Lyngsø
2025-01-14 16:26:11 +01:00
committed by GitHub

View File

@@ -32,6 +32,9 @@ export class UmbObserver<T> {
wantedToClose = true;
} else {
subscription.unsubscribe();
if (!this.#callback) {
this.destroy();
}
}
resolve(value as Exclude<T, undefined>);
}
@@ -39,6 +42,9 @@ export class UmbObserver<T> {
initialCallback = false;
if (wantedToClose) {
subscription.unsubscribe();
if (!this.#callback) {
this.destroy();
}
}
});
}