@ngxs/store 3.7.5-dev.master-0208977 → 3.7.5-dev.master-5a8fe1f

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.
@@ -3,7 +3,7 @@ import { NgZone, Injectable, Inject, PLATFORM_ID, defineInjectable, inject, Inje
3
3
  import { memoize, INITIAL_STATE_TOKEN, NgxsBootstrapper, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, InitialState } from '@ngxs/store/internals';
4
4
  import { isPlatformServer } from '@angular/common';
5
5
  import { Observable, Subject, BehaviorSubject, of, forkJoin, throwError, EMPTY, from, isObservable, queueScheduler } from 'rxjs';
6
- import { filter, map, shareReplay, take, exhaustMap, mergeMap, defaultIfEmpty, catchError, takeUntil, observeOn, distinctUntilChanged, tap, startWith, pairwise } from 'rxjs/operators';
6
+ import { filter, map, share, shareReplay, take, exhaustMap, mergeMap, defaultIfEmpty, catchError, takeUntil, observeOn, distinctUntilChanged, tap, startWith, pairwise } from 'rxjs/operators';
7
7
 
8
8
  /**
9
9
  * @fileoverview added by tsickle
@@ -1590,15 +1590,21 @@ var InternalActions = /** @class */ (function (_super) {
1590
1590
  var Actions = /** @class */ (function (_super) {
1591
1591
  __extends(Actions, _super);
1592
1592
  function Actions(internalActions$, internalExecutionStrategy) {
1593
- return _super.call(this, (/**
1593
+ var _this = this;
1594
+ /** @type {?} */
1595
+ var sharedInternalActions$ = internalActions$.pipe(leaveNgxs(internalExecutionStrategy),
1596
+ // The `InternalActions` subject emits outside of the Angular zone.
1597
+ // We have to re-enter the Angular zone for any incoming consumer.
1598
+ // The `share()` operator reduces the number of change detections.
1599
+ // This would call leave only once for any stream emission across all active subscribers.
1600
+ share());
1601
+ _this = _super.call(this, (/**
1594
1602
  * @param {?} observer
1595
1603
  * @return {?}
1596
1604
  */
1597
1605
  function (observer) {
1598
1606
  /** @type {?} */
1599
- var childSubscription = internalActions$
1600
- .pipe(leaveNgxs(internalExecutionStrategy))
1601
- .subscribe({
1607
+ var childSubscription = sharedInternalActions$.subscribe({
1602
1608
  next: (/**
1603
1609
  * @param {?} ctx
1604
1610
  * @return {?}
@@ -1616,6 +1622,7 @@ var Actions = /** @class */ (function (_super) {
1616
1622
  });
1617
1623
  observer.add(childSubscription);
1618
1624
  })) || this;
1625
+ return _this;
1619
1626
  }
1620
1627
  Actions.decorators = [
1621
1628
  { type: Injectable }