@osovitny/anatoly 3.20.40 → 3.20.41

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.
@@ -1328,6 +1328,37 @@ var ModerationStatus;
1328
1328
  ModerationStatus[ModerationStatus["Rejected"] = 4] = "Rejected"; //item is rejected by Moderator
1329
1329
  })(ModerationStatus || (ModerationStatus = {}));
1330
1330
 
1331
+ /*
1332
+ <file>
1333
+ Project:
1334
+ @osovitny/anatoly
1335
+
1336
+ Authors:
1337
+ Vadim Osovitny vadim.osovitny@osovitny.com
1338
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
1339
+
1340
+ Created:
1341
+ 26 Jun 2020
1342
+
1343
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1344
+ </file>
1345
+ */
1346
+ class Subs {
1347
+ constructor() {
1348
+ this.subs = [];
1349
+ }
1350
+ add(...subscriptions) {
1351
+ this.subs = this.subs.concat(subscriptions);
1352
+ }
1353
+ set sink(subscription) {
1354
+ this.subs.push(subscription);
1355
+ }
1356
+ unsubscribe() {
1357
+ this.subs.forEach((sub) => sub && sub.unsubscribe());
1358
+ this.subs = [];
1359
+ }
1360
+ }
1361
+
1331
1362
  /*
1332
1363
  <file>
1333
1364
  Project:
@@ -1348,8 +1379,13 @@ class GoServiceBase {
1348
1379
  this.route = route;
1349
1380
  this.router = router;
1350
1381
  this.initialized = false;
1382
+ //protected
1383
+ this.subs = new Subs();
1351
1384
  this.isDevMode = false;
1352
1385
  }
1386
+ ngOnDestroy() {
1387
+ this.subs.unsubscribe();
1388
+ }
1353
1389
  ensureInitialized() {
1354
1390
  if (!this.initialized) {
1355
1391
  this.isDevMode = IsDevMode;
@@ -2677,37 +2713,6 @@ class StarterGuard {
2677
2713
  type: Injectable
2678
2714
  }], () => [{ type: StarterService }], null); })();
2679
2715
 
2680
- /*
2681
- <file>
2682
- Project:
2683
- @osovitny/anatoly
2684
-
2685
- Authors:
2686
- Vadim Osovitny vadim.osovitny@osovitny.com
2687
- Anatoly Osovitny anatoly.osovitny@osovitny.com
2688
-
2689
- Created:
2690
- 26 Jun 2020
2691
-
2692
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
2693
- </file>
2694
- */
2695
- class Subs {
2696
- constructor() {
2697
- this.subs = [];
2698
- }
2699
- add(...subscriptions) {
2700
- this.subs = this.subs.concat(subscriptions);
2701
- }
2702
- set sink(subscription) {
2703
- this.subs.push(subscription);
2704
- }
2705
- unsubscribe() {
2706
- this.subs.forEach((sub) => sub && sub.unsubscribe());
2707
- this.subs = [];
2708
- }
2709
- }
2710
-
2711
2716
  /*
2712
2717
  <file>
2713
2718
  Project: