@mtgame/core 0.1.59 → 0.1.61
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,19 +9935,23 @@
|
|
|
9935
9935
|
}(StorageEngine));
|
|
9936
9936
|
|
|
9937
9937
|
function componentDestroyed(component) {
|
|
9938
|
-
if (component.
|
|
9939
|
-
|
|
9938
|
+
if (!component.__decoratorApplied) {
|
|
9939
|
+
throw new Error('Use @UntilDestroy decorator in class');
|
|
9940
9940
|
}
|
|
9941
|
-
|
|
9941
|
+
if (!component.__componentDestroyed$) {
|
|
9942
|
+
component.__componentDestroyed$ = new Subject.Subject();
|
|
9943
|
+
}
|
|
9944
|
+
return component.__componentDestroyed$;
|
|
9942
9945
|
}
|
|
9943
9946
|
function UntilDestroy(cmpType) {
|
|
9944
|
-
var
|
|
9945
|
-
|
|
9946
|
-
cmpType.
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9947
|
+
var original = cmpType.prototype.ngOnDestroy;
|
|
9948
|
+
cmpType.prototype.__componentDestroyed$ = new Subject.Subject();
|
|
9949
|
+
cmpType.prototype.__decoratorApplied = true;
|
|
9950
|
+
cmpType.prototype.ngOnDestroy = function () {
|
|
9951
|
+
this.__componentDestroyed$.next();
|
|
9952
|
+
this.__componentDestroyed$.complete();
|
|
9953
|
+
delete this.__componentDestroyed$;
|
|
9954
|
+
original.call(this);
|
|
9951
9955
|
};
|
|
9952
9956
|
}
|
|
9953
9957
|
function getDef(type) {
|