@ngxs/store 3.7.3-dev.master-5175b98 → 3.7.3-dev.master-d470dff
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.
- package/bundles/ngxs-store-internals-testing.umd.js +63 -0
- package/bundles/ngxs-store-internals-testing.umd.js.map +1 -1
- package/bundles/ngxs-store-internals-testing.umd.min.js +2 -2
- package/bundles/ngxs-store-internals-testing.umd.min.js.map +1 -1
- package/bundles/ngxs-store.umd.js +19 -4
- package/bundles/ngxs-store.umd.js.map +1 -1
- package/bundles/ngxs-store.umd.min.js +1 -1
- package/bundles/ngxs-store.umd.min.js.map +1 -1
- package/esm2015/internals/testing/index.js +2 -1
- package/esm2015/internals/testing/ngxs-store-internals-testing.js +2 -2
- package/esm2015/internals/testing/skip-console-logging.js +62 -0
- package/esm2015/src/internal/state-operations.js +18 -5
- package/esm2015/src/symbols.js +4 -1
- package/esm5/internals/testing/index.js +2 -1
- package/esm5/internals/testing/ngxs-store-internals-testing.js +2 -2
- package/esm5/internals/testing/skip-console-logging.js +62 -0
- package/esm5/src/internal/state-operations.js +18 -5
- package/esm5/src/symbols.js +4 -1
- package/fesm2015/ngxs-store-internals-testing.js +63 -1
- package/fesm2015/ngxs-store-internals-testing.js.map +1 -1
- package/fesm2015/ngxs-store.js +20 -5
- package/fesm2015/ngxs-store.js.map +1 -1
- package/fesm5/ngxs-store-internals-testing.js +63 -1
- package/fesm5/ngxs-store-internals-testing.js.map +1 -1
- package/fesm5/ngxs-store.js +20 -5
- package/fesm5/ngxs-store.js.map +1 -1
- package/internals/testing/index.d.ts +1 -0
- package/internals/testing/ngxs-store-internals-testing.metadata.json +1 -1
- package/internals/testing/skip-console-logging.d.ts +1 -0
- package/ngxs-store.metadata.json +1 -1
- package/package.json +1 -1
- package/src/symbols.d.ts +3 -0
|
@@ -249,6 +249,68 @@ function freshPlatform(fn) {
|
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
/**
|
|
253
|
+
* @fileoverview added by tsickle
|
|
254
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
255
|
+
*/
|
|
256
|
+
/// <reference types="jest" />
|
|
257
|
+
/// <reference types="jest" />
|
|
258
|
+
/**
|
|
259
|
+
* @template T
|
|
260
|
+
* @param {?} fn
|
|
261
|
+
* @return {?}
|
|
262
|
+
*/
|
|
263
|
+
function skipConsoleLogging(fn) {
|
|
264
|
+
/** @type {?} */
|
|
265
|
+
var consoleSpies = [
|
|
266
|
+
jest.spyOn(console, 'log').mockImplementation((/**
|
|
267
|
+
* @return {?}
|
|
268
|
+
*/
|
|
269
|
+
function () { })),
|
|
270
|
+
jest.spyOn(console, 'warn').mockImplementation((/**
|
|
271
|
+
* @return {?}
|
|
272
|
+
*/
|
|
273
|
+
function () { })),
|
|
274
|
+
jest.spyOn(console, 'error').mockImplementation((/**
|
|
275
|
+
* @return {?}
|
|
276
|
+
*/
|
|
277
|
+
function () { })),
|
|
278
|
+
jest.spyOn(console, 'info').mockImplementation((/**
|
|
279
|
+
* @return {?}
|
|
280
|
+
*/
|
|
281
|
+
function () { }))
|
|
282
|
+
];
|
|
283
|
+
/**
|
|
284
|
+
* @return {?}
|
|
285
|
+
*/
|
|
286
|
+
function restoreSpies() {
|
|
287
|
+
consoleSpies.forEach((/**
|
|
288
|
+
* @param {?} spy
|
|
289
|
+
* @return {?}
|
|
290
|
+
*/
|
|
291
|
+
function (spy) { return spy.mockRestore(); }));
|
|
292
|
+
}
|
|
293
|
+
/** @type {?} */
|
|
294
|
+
var restoreSpyAsync = false;
|
|
295
|
+
try {
|
|
296
|
+
/** @type {?} */
|
|
297
|
+
var returnValue = fn();
|
|
298
|
+
if (returnValue instanceof Promise) {
|
|
299
|
+
restoreSpyAsync = true;
|
|
300
|
+
return (/** @type {?} */ (returnValue.finally((/**
|
|
301
|
+
* @return {?}
|
|
302
|
+
*/
|
|
303
|
+
function () { return restoreSpies(); }))));
|
|
304
|
+
}
|
|
305
|
+
return returnValue;
|
|
306
|
+
}
|
|
307
|
+
finally {
|
|
308
|
+
if (!restoreSpyAsync) {
|
|
309
|
+
restoreSpies();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
252
314
|
/**
|
|
253
315
|
* @fileoverview added by tsickle
|
|
254
316
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -259,5 +321,5 @@ function freshPlatform(fn) {
|
|
|
259
321
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
260
322
|
*/
|
|
261
323
|
|
|
262
|
-
export { NgxsTestBed, freshPlatform };
|
|
324
|
+
export { NgxsTestBed, freshPlatform, skipConsoleLogging };
|
|
263
325
|
//# sourceMappingURL=ngxs-store-internals-testing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngxs-store-internals-testing.js","sources":["ng://@ngxs/store/internals/testing/helpers/ngxs-test.component.ts","ng://@ngxs/store/internals/testing/helpers/ngxs-test.module.ts","ng://@ngxs/store/internals/testing/ngxs.setup.ts","ng://@ngxs/store/internals/testing/fresh-platform.ts"],"sourcesContent":["import { AfterViewInit, Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-root',\n template: ''\n})\nexport class NgxsTestComponent implements OnInit, AfterViewInit {\n public ngOnInit(): void {}\n public ngAfterViewInit(): void {}\n}\n","import { ApplicationRef, NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\n\nimport { NgxsTestComponent } from './ngxs-test.component';\n\n@NgModule({\n imports: [BrowserModule],\n declarations: [NgxsTestComponent],\n entryComponents: [NgxsTestComponent]\n})\nexport class NgxsTestModule {\n public static ngDoBootstrap(app: ApplicationRef): void {\n app.bootstrap(NgxsTestComponent);\n }\n}\n","import { ApplicationRef } from '@angular/core';\nimport { TestBed, TestBedStatic } from '@angular/core/testing';\nimport { DOCUMENT } from '@angular/common';\nimport { ɵBrowserDomAdapter as BrowserDomAdapter } from '@angular/platform-browser';\nimport {\n BrowserDynamicTestingModule,\n platformBrowserDynamicTesting\n} from '@angular/platform-browser-dynamic/testing';\nimport { NgxsModule, Store } from '@ngxs/store';\n\nimport { NgxsTestModule } from './helpers/ngxs-test.module';\nimport { NgxsOptionsTesting, NgxsTesting } from './symbol';\n\nexport class NgxsTestBed {\n public static configureTestingStates(options: NgxsOptionsTesting): NgxsTesting {\n this.resetTestBed();\n\n if (options.before) {\n options.before();\n }\n\n TestBed.configureTestingModule({\n imports: [\n NgxsTestModule,\n NgxsModule.forRoot(options.states || [], options.ngxsOptions || {}),\n ...(options.imports || [])\n ]\n }).compileComponents();\n\n NgxsTestBed.ngxsBootstrap();\n\n return {\n get store(): Store {\n return TestBed.inject(Store);\n },\n get getTestBed(): TestBedStatic {\n return TestBed;\n }\n };\n }\n\n private static ngxsBootstrap(): void {\n NgxsTestBed.createRootNode();\n NgxsTestModule.ngDoBootstrap(TestBed.inject(ApplicationRef));\n }\n\n private static resetTestBed(): void {\n TestBed.resetTestEnvironment();\n TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());\n }\n\n private static createRootNode(selector = 'app-root'): void {\n const document = TestBed.inject(DOCUMENT);\n const adapter = new BrowserDomAdapter();\n const root = adapter.createElement(selector);\n document.body.appendChild(root);\n }\n}\n","import { TestBed } from '@angular/core/testing';\nimport { DOCUMENT } from '@angular/common';\nimport { ɵgetDOM as getDOM } from '@angular/platform-browser';\nimport { destroyPlatform, createPlatform } from '@angular/core';\n\nfunction createRootElement() {\n const document = TestBed.inject(DOCUMENT);\n const root = getDOM().createElement('app-root', document);\n document.body.appendChild(root);\n}\n\nfunction removeRootElement() {\n const root: Element = document.getElementsByTagName('app-root').item(0)!;\n try {\n document.body.removeChild(root);\n } catch {}\n}\n\nfunction destroyPlatformBeforeBootstrappingTheNewOne() {\n destroyPlatform();\n createRootElement();\n}\n\n// As we create our custom platform via `bootstrapModule`\n// we have to destroy it after assetions and revert\n// the previous one\nfunction resetPlatformAfterBootstrapping() {\n removeRootElement();\n destroyPlatform();\n createPlatform(TestBed);\n}\n\nexport function freshPlatform(fn: (done?: VoidFunction) => Promise<void>) {\n let done: VoidFunction | null = null,\n whenDoneIsCalledPromise: Promise<void> | null = null;\n\n const hasDoneArgument = fn.length === 1;\n\n if (hasDoneArgument) {\n whenDoneIsCalledPromise = new Promise<void>(resolve => {\n done = resolve;\n });\n }\n\n return async function testWithAFreshPlatform() {\n try {\n destroyPlatformBeforeBootstrappingTheNewOne();\n\n if (done !== null) {\n await fn(done);\n await whenDoneIsCalledPromise!;\n } else {\n await fn();\n }\n } finally {\n resetPlatformAfterBootstrapping();\n }\n };\n}\n"],"names":["BrowserDomAdapter","getDOM"],"mappings":";;;;;;;;;;;;AAAA,AAEA;IAAA;KAOC;;;;IAFQ,oCAAQ;;;IAAf,eAA0B;;;;IACnB,2CAAe;;;IAAtB,eAAiC;;gBANlC,SAAS,SAAC;oBACT,QAAQ,EAAE,UAAU;oBACpB,QAAQ,EAAE,EAAE;iBACb;;IAID,wBAAC;CAPD,IAOC;;;;;;ACTD,AAKA;IAAA;KASC;;;;;IAHe,4BAAa;;;;IAA3B,UAA4B,GAAmB;QAC7C,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;KAClC;;gBARF,QAAQ,SAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,eAAe,EAAE,CAAC,iBAAiB,CAAC;iBACrC;;IAKD,qBAAC;CATD,IASC;;;;;;;ICDD;KA4CC;;;;;IA3Ce,kCAAsB;;;;IAApC,UAAqC,OAA2B;QAC9D,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,OAAO,CAAC,MAAM,EAAE,CAAC;SAClB;Q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,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;CACjC;;;;AAED,SAAS,iBAAiB;;QAClB,IAAI,sBAAY,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC;IACxE,IAAI;QACF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;KACjC;IAAC,WAAM,GAAE;CACX;;;;AAED,SAAS,2CAA2C;IAClD,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,CAAC;CACrB;;;;;;;AAKD,SAAS,+BAA+B;IACtC,iBAAiB,EAAE,CAAC;IACpB,eAAe,EAAE,CAAC;IAClB,cAAc,CAAC,OAAO,CAAC,CAAC;CACzB;;;;;AAED,SAAgB,aAAa,CAAC,EAA0C;;QAClE,IAAI,GAAwB,IAAI;;QAClC,uBAAuB,GAAyB,IAAI;;QAEhD,eAAe,GAAG,EAAE,CAAC,MAAM,KAAK,CAAC;IAEvC,IAAI,eAAe,EAAE;QACnB,uBAAuB,GAAG,IAAI,OAAO;;;;QAAO,UAAA,OAAO;YACjD,IAAI,GAAG,OAAO,CAAC;SAChB,EAAC,CAAC;KACJ;IAED;;;IAAO,SAAe,sBAAsB;;;;;;wBAExC,2CAA2C,EAAE,CAAC;8BAE1C,IAAI,KAAK,IAAI,CAAA,EAAb,wBAAa;wBACf,qBAAM,EAAE,CAAC,IAAI,CAAC,EAAA;;wBAAd,SAAc,CAAC;wBACf,wCAAM,uBAAuB,IAAC;;wBAA9B,SAA8B,CAAC;;4BAE/B,qBAAM,EAAE,EAAE,EAAA;;wBAAV,SAAU,CAAC;;;;wBAGb,+BAA+B,EAAE,CAAC;;;;;;KAErC,EAAC;CACH;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngxs-store-internals-testing.js","sources":["ng://@ngxs/store/internals/testing/helpers/ngxs-test.component.ts","ng://@ngxs/store/internals/testing/helpers/ngxs-test.module.ts","ng://@ngxs/store/internals/testing/ngxs.setup.ts","ng://@ngxs/store/internals/testing/fresh-platform.ts","ng://@ngxs/store/internals/testing/skip-console-logging.ts"],"sourcesContent":["import { AfterViewInit, Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-root',\n template: ''\n})\nexport class NgxsTestComponent implements OnInit, AfterViewInit {\n public ngOnInit(): void {}\n public ngAfterViewInit(): void {}\n}\n","import { ApplicationRef, NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\n\nimport { NgxsTestComponent } from './ngxs-test.component';\n\n@NgModule({\n imports: [BrowserModule],\n declarations: [NgxsTestComponent],\n entryComponents: [NgxsTestComponent]\n})\nexport class NgxsTestModule {\n public static ngDoBootstrap(app: ApplicationRef): void {\n app.bootstrap(NgxsTestComponent);\n }\n}\n","import { ApplicationRef } from '@angular/core';\nimport { TestBed, TestBedStatic } from '@angular/core/testing';\nimport { DOCUMENT } from '@angular/common';\nimport { ɵBrowserDomAdapter as BrowserDomAdapter } from '@angular/platform-browser';\nimport {\n BrowserDynamicTestingModule,\n platformBrowserDynamicTesting\n} from '@angular/platform-browser-dynamic/testing';\nimport { NgxsModule, Store } from '@ngxs/store';\n\nimport { NgxsTestModule } from './helpers/ngxs-test.module';\nimport { NgxsOptionsTesting, NgxsTesting } from './symbol';\n\nexport class NgxsTestBed {\n public static configureTestingStates(options: NgxsOptionsTesting): NgxsTesting {\n this.resetTestBed();\n\n if (options.before) {\n options.before();\n }\n\n TestBed.configureTestingModule({\n imports: [\n NgxsTestModule,\n NgxsModule.forRoot(options.states || [], options.ngxsOptions || {}),\n ...(options.imports || [])\n ]\n }).compileComponents();\n\n NgxsTestBed.ngxsBootstrap();\n\n return {\n get store(): Store {\n return TestBed.inject(Store);\n },\n get getTestBed(): TestBedStatic {\n return TestBed;\n }\n };\n }\n\n private static ngxsBootstrap(): void {\n NgxsTestBed.createRootNode();\n NgxsTestModule.ngDoBootstrap(TestBed.inject(ApplicationRef));\n }\n\n private static resetTestBed(): void {\n TestBed.resetTestEnvironment();\n TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());\n }\n\n private static createRootNode(selector = 'app-root'): void {\n const document = TestBed.inject(DOCUMENT);\n const adapter = new BrowserDomAdapter();\n const root = adapter.createElement(selector);\n document.body.appendChild(root);\n }\n}\n","import { TestBed } from '@angular/core/testing';\nimport { DOCUMENT } from '@angular/common';\nimport { ɵgetDOM as getDOM } from '@angular/platform-browser';\nimport { destroyPlatform, createPlatform } from '@angular/core';\n\nfunction createRootElement() {\n const document = TestBed.inject(DOCUMENT);\n const root = getDOM().createElement('app-root', document);\n document.body.appendChild(root);\n}\n\nfunction removeRootElement() {\n const root: Element = document.getElementsByTagName('app-root').item(0)!;\n try {\n document.body.removeChild(root);\n } catch {}\n}\n\nfunction destroyPlatformBeforeBootstrappingTheNewOne() {\n destroyPlatform();\n createRootElement();\n}\n\n// As we create our custom platform via `bootstrapModule`\n// we have to destroy it after assetions and revert\n// the previous one\nfunction resetPlatformAfterBootstrapping() {\n removeRootElement();\n destroyPlatform();\n createPlatform(TestBed);\n}\n\nexport function freshPlatform(fn: (done?: VoidFunction) => Promise<void>) {\n let done: VoidFunction | null = null,\n whenDoneIsCalledPromise: Promise<void> | null = null;\n\n const hasDoneArgument = fn.length === 1;\n\n if (hasDoneArgument) {\n whenDoneIsCalledPromise = new Promise<void>(resolve => {\n done = resolve;\n });\n }\n\n return async function testWithAFreshPlatform() {\n try {\n destroyPlatformBeforeBootstrappingTheNewOne();\n\n if (done !== null) {\n await fn(done);\n await whenDoneIsCalledPromise!;\n } else {\n await fn();\n }\n } finally {\n resetPlatformAfterBootstrapping();\n }\n };\n}\n","/// <reference types=\"jest\" />\n\nexport function skipConsoleLogging<T extends (...args: any[]) => any>(fn: T): ReturnType<T> {\n const consoleSpies = [\n jest.spyOn(console, 'log').mockImplementation(() => {}),\n jest.spyOn(console, 'warn').mockImplementation(() => {}),\n jest.spyOn(console, 'error').mockImplementation(() => {}),\n jest.spyOn(console, 'info').mockImplementation(() => {})\n ];\n function restoreSpies() {\n consoleSpies.forEach(spy => spy.mockRestore());\n }\n let restoreSpyAsync = false;\n try {\n const returnValue = fn();\n if (returnValue instanceof Promise) {\n restoreSpyAsync = true;\n return returnValue.finally(() => restoreSpies()) as ReturnType<T>;\n }\n return returnValue;\n } finally {\n if (!restoreSpyAsync) {\n restoreSpies();\n }\n }\n}\n"],"names":["BrowserDomAdapter","getDOM"],"mappings":";;;;;;;;;;;;AAAA,AAEA;IAAA;KAOC;;;;IAFQ,oCAAQ;;;IAAf,eAA0B;;;;IACnB,2CAAe;;;IAAtB,eAAiC;;gBANlC,SAAS,SAAC;oBACT,QAAQ,EAAE,UAAU;oBACpB,QAAQ,EAAE,EAAE;iBACb;;IAID,wBAAC;CAPD,IAOC;;;;;;ACTD,AAKA;IAAA;KASC;;;;;IAHe,4BAAa;;;;IAA3B,UAA4B,GAAmB;QAC7C,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;KAClC;;gBARF,QAAQ,SAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,eAAe,EAAE,CAAC,iBAAiB,CAAC;iBACrC;;IAKD,qBAAC;CATD,IASC;;;;;;;ICDD;KA4CC;;;;;IA3Ce,kCAAsB;;;;IAApC,UAAqC,OAA2B;QAC9D,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,OAAO,CAAC,MAAM,EAAE,CAAC;SAClB;QAED,OAAO,CAAC,sBAAsB,CAAC;YAC7B,OAAO;gBACL,cAAc;gBACd,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC;gBAC/D,OAAO,CAAC,OAAO,IAAI,EAAE,EAC1B;SACF,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAEvB,WAAW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AAkB;;;QAAC,eAAQ,EAAC;KACzD;;;;IACD,SAAS,YAAY;QACnB,YAAY,CAAC,OAAO;;;;QAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,WAAW,EAAE,GAAA,EAAC,CAAC;KAChD;;QACG,eAAe,GAAG,KAAK;IAC3B,IAAI;;YACI,WAAW,GAAG,EAAE,EAAE;QACxB,IAAI,WAAW,YAAY,OAAO,EAAE;YAClC,eAAe,GAAG,IAAI,CAAC;YACvB,0BAAO,WAAW,CAAC,OAAO;;;YAAC,cAAM,OAAA,YAAY,EAAE,GAAA,EAAC,GAAkB;SACnE;QACD,OAAO,WAAW,CAAC;KACpB;YAAS;QACR,IAAI,CAAC,eAAe,EAAE;YACpB,YAAY,EAAE,CAAC;SAChB;KACF;CACF;;;;;;;;;;;;;;"}
|
package/fesm5/ngxs-store.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __spread, __extends, __values } from 'tslib';
|
|
2
2
|
import { NgZone, Injectable, Inject, PLATFORM_ID, InjectionToken, Optional, SkipSelf, ErrorHandler, Injector, defineInjectable, inject, ɵivyEnabled, NgModule, APP_BOOTSTRAP_LISTENER } from '@angular/core';
|
|
3
|
-
import { memoize, INITIAL_STATE_TOKEN, NgxsBootstrapper, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, InitialState, ensureInjectorNotifierIsCaptured, localInject, ensureLocalInjectorCaptured } from '@ngxs/store/internals';
|
|
3
|
+
import { isAngularInTestMode, memoize, INITIAL_STATE_TOKEN, NgxsBootstrapper, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, InitialState, ensureInjectorNotifierIsCaptured, localInject, ensureLocalInjectorCaptured } 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, distinctUntilChanged } from 'rxjs/operators';
|
|
@@ -254,6 +254,9 @@ if (false) {
|
|
|
254
254
|
* Run in development mode. This will add additional debugging features:
|
|
255
255
|
* - Object.freeze on the state and actions to guarantee immutability
|
|
256
256
|
* (default: false)
|
|
257
|
+
*
|
|
258
|
+
* @deprecated This property is no longer necessary when the Ivy compiler is used.
|
|
259
|
+
* We'll determine the development mode through the `ngDevMode`. It's still essential with View Engine.
|
|
257
260
|
* @type {?}
|
|
258
261
|
*/
|
|
259
262
|
NgxsConfig.prototype.developmentMode;
|
|
@@ -2043,9 +2046,22 @@ var InternalStateOperations = /** @class */ (function () {
|
|
|
2043
2046
|
*/
|
|
2044
2047
|
function (actionOrActions) { return _this._dispatcher.dispatch(actionOrActions); })
|
|
2045
2048
|
};
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
+
// We have to have that duplication since this will allow us to tree-shake `ensureStateAndActionsAreImmutable`
|
|
2050
|
+
// and `deepFreeze` in Ivy production build.
|
|
2051
|
+
// The below `if` condition checks 2 things:
|
|
2052
|
+
// 1) if we're in View Engine (`ngDevMode` is `undefined`)
|
|
2053
|
+
// 2) if we're running tests, we should fallback to `config.developmentMode` to be backwards-compatible
|
|
2054
|
+
if (typeof ngDevMode === 'undefined' || (ngDevMode && isAngularInTestMode())) {
|
|
2055
|
+
return this._config.developmentMode
|
|
2056
|
+
? ensureStateAndActionsAreImmutable(rootStateOperations)
|
|
2057
|
+
: rootStateOperations;
|
|
2058
|
+
}
|
|
2059
|
+
else {
|
|
2060
|
+
// If we're in Ivy and not running tests, then tree-shake `ensureStateAndActionsAreImmutable` and `deepFreeze`.
|
|
2061
|
+
return ngDevMode
|
|
2062
|
+
? ensureStateAndActionsAreImmutable(rootStateOperations)
|
|
2063
|
+
: rootStateOperations;
|
|
2064
|
+
}
|
|
2049
2065
|
};
|
|
2050
2066
|
/**
|
|
2051
2067
|
* @param {?} results
|
|
@@ -2092,7 +2108,6 @@ if (false) {
|
|
|
2092
2108
|
*/
|
|
2093
2109
|
InternalStateOperations.prototype._config;
|
|
2094
2110
|
}
|
|
2095
|
-
// We make it as a separate function and not the class method to tree-shake it in the future.
|
|
2096
2111
|
/**
|
|
2097
2112
|
* @param {?} root
|
|
2098
2113
|
* @return {?}
|