Merge pull request #17943 from umbraco/v15/feature/no-callback-then-destroy
Feature: no callback then destroy
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user