@mtgame/core 0.1.60 → 0.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9935,23 +9935,24 @@
|
|
|
9935
9935
|
}(StorageEngine));
|
|
9936
9936
|
|
|
9937
9937
|
function componentDestroyed(component) {
|
|
9938
|
-
if (!component.
|
|
9938
|
+
if (!component.__decoratorApplied) {
|
|
9939
9939
|
throw new Error('Use @UntilDestroy decorator in class');
|
|
9940
9940
|
}
|
|
9941
|
-
if (!component.
|
|
9942
|
-
component.
|
|
9941
|
+
if (!component.__componentDestroyed$) {
|
|
9942
|
+
component.__componentDestroyed$ = new Subject.Subject();
|
|
9943
9943
|
}
|
|
9944
|
-
return component.
|
|
9944
|
+
return component.__componentDestroyed$;
|
|
9945
9945
|
}
|
|
9946
9946
|
function UntilDestroy(cmpType) {
|
|
9947
9947
|
var original = cmpType.prototype.ngOnDestroy;
|
|
9948
|
-
cmpType.
|
|
9949
|
-
cmpType.__decoratorApplied = true;
|
|
9948
|
+
cmpType.prototype.__decoratorApplied = true;
|
|
9950
9949
|
cmpType.prototype.ngOnDestroy = function () {
|
|
9951
|
-
cmpType.__componentDestroyed$.next();
|
|
9952
|
-
cmpType.__componentDestroyed$.complete();
|
|
9953
|
-
delete cmpType.__componentDestroyed$;
|
|
9954
9950
|
original.call(this);
|
|
9951
|
+
if (this.__componentDestroyed$) {
|
|
9952
|
+
this.__componentDestroyed$.next();
|
|
9953
|
+
this.__componentDestroyed$.complete();
|
|
9954
|
+
delete this.__componentDestroyed$;
|
|
9955
|
+
}
|
|
9955
9956
|
};
|
|
9956
9957
|
}
|
|
9957
9958
|
function getDef(type) {
|