@ngxs/store 3.7.3-dev.master-28d6804 → 3.7.3-dev.master-6ba2ac1

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.
@@ -3644,6 +3644,12 @@
3644
3644
  this._config = _config;
3645
3645
  this._internalExecutionStrategy = _internalExecutionStrategy;
3646
3646
  this._stateFactory = _stateFactory;
3647
+ /**
3648
+ * This is a derived state stream that leaves NGXS execution strategy to emit state changes within the Angular zone,
3649
+ * because state is being changed actually within the `<root>` zone, see `InternalDispatcher#dispatchSingle`.
3650
+ * All selects would use this stream, and it would call leave only once for any state change across all active selectors.
3651
+ */
3652
+ this._selectableStateStream = this._stateStream.pipe(leaveNgxs(this._internalExecutionStrategy), operators.publishReplay(1), operators.refCount());
3647
3653
  this.initStateStream(initialStateValue);
3648
3654
  }
3649
3655
  /**
@@ -3674,7 +3680,7 @@
3674
3680
  var _this = this;
3675
3681
  /** @type {?} */
3676
3682
  var selectorFn = this.getStoreBoundSelectorFn(selector);
3677
- return this._stateStream.pipe(operators.map(selectorFn), operators.catchError((/**
3683
+ return this._selectableStateStream.pipe(operators.map(selectorFn), operators.catchError((/**
3678
3684
  * @param {?} err
3679
3685
  * @return {?}
3680
3686
  */
@@ -3726,7 +3732,9 @@
3726
3732
  * @return {?}
3727
3733
  */
3728
3734
  function (fn) {
3729
- return this._stateStream.pipe(leaveNgxs(this._internalExecutionStrategy)).subscribe(fn);
3735
+ return this._selectableStateStream
3736
+ .pipe(leaveNgxs(this._internalExecutionStrategy))
3737
+ .subscribe(fn);
3730
3738
  };
3731
3739
  /**
3732
3740
  * Return the raw value of the state.
@@ -3817,6 +3825,14 @@
3817
3825
  return Store;
3818
3826
  }());
3819
3827
  if (false) {
3828
+ /**
3829
+ * This is a derived state stream that leaves NGXS execution strategy to emit state changes within the Angular zone,
3830
+ * because state is being changed actually within the `<root>` zone, see `InternalDispatcher#dispatchSingle`.
3831
+ * All selects would use this stream, and it would call leave only once for any state change across all active selectors.
3832
+ * @type {?}
3833
+ * @private
3834
+ */
3835
+ Store.prototype._selectableStateStream;
3820
3836
  /**
3821
3837
  * @type {?}
3822
3838
  * @private