@ngxs/store 3.7.4-dev.master-80a3014 → 3.7.4-dev.master-c961545

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.
@@ -1,6 +1,6 @@
1
1
  import { __assign, __spread, __extends, __values } from 'tslib';
2
2
  import { NgZone, Injectable, Inject, PLATFORM_ID, defineInjectable, inject, InjectionToken, INJECTOR, ɵglobal, Optional, SkipSelf, ErrorHandler, Injector, ɵivyEnabled, NgModule, APP_BOOTSTRAP_LISTENER } from '@angular/core';
3
- import { isAngularInTestMode, memoize, INITIAL_STATE_TOKEN, NgxsBootstrapper, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, InitialState } from '@ngxs/store/internals';
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 } from 'rxjs';
6
6
  import { filter, map, shareReplay, take, exhaustMap, mergeMap, defaultIfEmpty, catchError, takeUntil, tap, publishReplay, refCount, distinctUntilChanged } from 'rxjs/operators';
@@ -256,8 +256,9 @@ if (false) {
256
256
  * - Object.freeze on the state and actions to guarantee immutability
257
257
  * (default: false)
258
258
  *
259
- * @deprecated This property is no longer necessary when the Ivy compiler is used.
260
- * We'll determine the development mode through the `ngDevMode`. It's still essential with View Engine.
259
+ * Note: this property will be accounted only in development mode when using the Ivy compiler.
260
+ * It makes sense to use it only during development to ensure there're no state mutations.
261
+ * When building for production, the Object.freeze will be tree-shaken away.
261
262
  * @type {?}
262
263
  */
263
264
  NgxsConfig.prototype.developmentMode;
@@ -2128,21 +2129,13 @@ var InternalStateOperations = /** @class */ (function () {
2128
2129
  */
2129
2130
  function (actionOrActions) { return _this._dispatcher.dispatch(actionOrActions); })
2130
2131
  };
2131
- // We have to have that duplication since this will allow us to tree-shake `ensureStateAndActionsAreImmutable`
2132
- // and `deepFreeze` in Ivy production build.
2133
- // The below `if` condition checks 2 things:
2134
- // 1) if we're in View Engine (`ngDevMode` is `undefined`)
2135
- // 2) if we're running tests, we should fallback to `config.developmentMode` to be backwards-compatible
2136
- if (typeof ngDevMode === 'undefined' || (ngDevMode && isAngularInTestMode())) {
2132
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
2137
2133
  return this._config.developmentMode
2138
2134
  ? ensureStateAndActionsAreImmutable(rootStateOperations)
2139
2135
  : rootStateOperations;
2140
2136
  }
2141
2137
  else {
2142
- // If we're in Ivy and not running tests, then tree-shake `ensureStateAndActionsAreImmutable` and `deepFreeze`.
2143
- return ngDevMode
2144
- ? ensureStateAndActionsAreImmutable(rootStateOperations)
2145
- : rootStateOperations;
2138
+ return rootStateOperations;
2146
2139
  }
2147
2140
  };
2148
2141
  /**