@ngxs/store 3.7.3-dev.master-d470dff → 3.7.3-dev.master-8ecbd7f

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,5 +1,5 @@
1
1
  import { __assign, __spread, __extends, __values } from 'tslib';
2
- import { NgZone, Injectable, Inject, PLATFORM_ID, InjectionToken, Optional, SkipSelf, ErrorHandler, Injector, defineInjectable, inject, ɵivyEnabled, NgModule, APP_BOOTSTRAP_LISTENER } from '@angular/core';
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
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';
@@ -164,13 +164,14 @@ var DispatchOutsideZoneNgxsExecutionStrategy = /** @class */ (function () {
164
164
  return func();
165
165
  };
166
166
  DispatchOutsideZoneNgxsExecutionStrategy.decorators = [
167
- { type: Injectable }
167
+ { type: Injectable, args: [{ providedIn: 'root' },] }
168
168
  ];
169
169
  /** @nocollapse */
170
170
  DispatchOutsideZoneNgxsExecutionStrategy.ctorParameters = function () { return [
171
171
  { type: NgZone },
172
172
  { type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
173
173
  ]; };
174
+ /** @nocollapse */ DispatchOutsideZoneNgxsExecutionStrategy.ngInjectableDef = defineInjectable({ factory: function DispatchOutsideZoneNgxsExecutionStrategy_Factory() { return new DispatchOutsideZoneNgxsExecutionStrategy(inject(NgZone), inject(PLATFORM_ID)); }, token: DispatchOutsideZoneNgxsExecutionStrategy, providedIn: "root" });
174
175
  return DispatchOutsideZoneNgxsExecutionStrategy;
175
176
  }());
176
177
  if (false) {
@@ -425,11 +426,72 @@ if (false) {
425
426
  * @fileoverview added by tsickle
426
427
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
427
428
  */
429
+ var NoopNgxsExecutionStrategy = /** @class */ (function () {
430
+ function NoopNgxsExecutionStrategy() {
431
+ }
432
+ /**
433
+ * @template T
434
+ * @param {?} func
435
+ * @return {?}
436
+ */
437
+ NoopNgxsExecutionStrategy.prototype.enter = /**
438
+ * @template T
439
+ * @param {?} func
440
+ * @return {?}
441
+ */
442
+ function (func) {
443
+ return func();
444
+ };
445
+ /**
446
+ * @template T
447
+ * @param {?} func
448
+ * @return {?}
449
+ */
450
+ NoopNgxsExecutionStrategy.prototype.leave = /**
451
+ * @template T
452
+ * @param {?} func
453
+ * @return {?}
454
+ */
455
+ function (func) {
456
+ return func();
457
+ };
458
+ NoopNgxsExecutionStrategy.decorators = [
459
+ { type: Injectable, args: [{ providedIn: 'root' },] }
460
+ ];
461
+ /** @nocollapse */ NoopNgxsExecutionStrategy.ngInjectableDef = defineInjectable({ factory: function NoopNgxsExecutionStrategy_Factory() { return new NoopNgxsExecutionStrategy(); }, token: NoopNgxsExecutionStrategy, providedIn: "root" });
462
+ return NoopNgxsExecutionStrategy;
463
+ }());
464
+
465
+ /**
466
+ * @fileoverview added by tsickle
467
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
468
+ */
469
+ /**
470
+ * The strategy that might be provided by users through `options.executionStrategy`.
471
+ * @type {?}
472
+ */
473
+ var USER_PROVIDED_NGXS_EXECUTION_STRATEGY = new InjectionToken('USER_PROVIDED_NGXS_EXECUTION_STRATEGY');
428
474
  /*
429
475
  * Internal execution strategy injection token
430
476
  */
431
477
  /** @type {?} */
432
- var NGXS_EXECUTION_STRATEGY = new InjectionToken('NGXS_EXECUTION_STRATEGY');
478
+ var NGXS_EXECUTION_STRATEGY = new InjectionToken('NGXS_EXECUTION_STRATEGY', {
479
+ providedIn: 'root',
480
+ factory: (/**
481
+ * @return {?}
482
+ */
483
+ function () {
484
+ /** @type {?} */
485
+ var injector = inject(INJECTOR);
486
+ /** @type {?} */
487
+ var executionStrategy = injector.get(USER_PROVIDED_NGXS_EXECUTION_STRATEGY);
488
+ return executionStrategy
489
+ ? injector.get(executionStrategy)
490
+ : injector.get(typeof ɵglobal.Zone !== 'undefined'
491
+ ? DispatchOutsideZoneNgxsExecutionStrategy
492
+ : NoopNgxsExecutionStrategy);
493
+ })
494
+ });
433
495
  /**
434
496
  * @record
435
497
  */
@@ -3835,8 +3897,8 @@ var NgxsModule = /** @class */ (function () {
3835
3897
  function (states, options) {
3836
3898
  return [
3837
3899
  {
3838
- provide: NGXS_EXECUTION_STRATEGY,
3839
- useClass: options.executionStrategy || DispatchOutsideZoneNgxsExecutionStrategy
3900
+ provide: USER_PROVIDED_NGXS_EXECUTION_STRATEGY,
3901
+ useValue: options.executionStrategy
3840
3902
  },
3841
3903
  {
3842
3904
  provide: ROOT_STATE_TOKEN,
@@ -4411,45 +4473,6 @@ function Selector(selectors) {
4411
4473
  });
4412
4474
  }
4413
4475
 
4414
- /**
4415
- * @fileoverview added by tsickle
4416
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4417
- */
4418
- var NoopNgxsExecutionStrategy = /** @class */ (function () {
4419
- function NoopNgxsExecutionStrategy() {
4420
- }
4421
- /**
4422
- * @template T
4423
- * @param {?} func
4424
- * @return {?}
4425
- */
4426
- NoopNgxsExecutionStrategy.prototype.enter = /**
4427
- * @template T
4428
- * @param {?} func
4429
- * @return {?}
4430
- */
4431
- function (func) {
4432
- return func();
4433
- };
4434
- /**
4435
- * @template T
4436
- * @param {?} func
4437
- * @return {?}
4438
- */
4439
- NoopNgxsExecutionStrategy.prototype.leave = /**
4440
- * @template T
4441
- * @param {?} func
4442
- * @return {?}
4443
- */
4444
- function (func) {
4445
- return func();
4446
- };
4447
- NoopNgxsExecutionStrategy.decorators = [
4448
- { type: Injectable }
4449
- ];
4450
- return NoopNgxsExecutionStrategy;
4451
- }());
4452
-
4453
4476
  /**
4454
4477
  * @fileoverview added by tsickle
4455
4478
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -4522,5 +4545,5 @@ if (false) {
4522
4545
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4523
4546
  */
4524
4547
 
4525
- export { Action, Actions, InitState, NGXS_PLUGINS, NgxsModule, NgxsSimpleChange, NoopNgxsExecutionStrategy, Select, Selector, SelectorOptions, State, StateStream, StateToken, Store, UpdateState, actionMatcher, createSelector, ensureSelectorMetadata$1 as ensureSelectorMetadata, ensureStoreMetadata$1 as ensureStoreMetadata, getActionTypeFromInstance, getSelectorMetadata$1 as getSelectorMetadata, getStoreMetadata$1 as getStoreMetadata, getValue, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, setValue, OrderedSubject as ɵa, InternalActions as ɵb, ROOT_STATE_TOKEN as ɵc, FEATURE_STATE_TOKEN as ɵd, SELECTOR_META_KEY as ɵe, NgxsConfig as ɵf, mergeDeep as ɵg, NGXS_EXECUTION_STRATEGY as ɵh, NgxsRootModule as ɵi, StateFactory as ɵj, InternalDispatchedActionResults as ɵk, InternalDispatcher as ɵl, StateContextFactory as ɵm, InternalStateOperations as ɵn, PluginManager as ɵo, InternalNgxsExecutionStrategy as ɵp, ensureStoreMetadata as ɵr, getStoreMetadata as ɵs, ensureSelectorMetadata as ɵt, getSelectorMetadata as ɵu, LifecycleStateManager as ɵv, NgxsFeatureModule as ɵw, DispatchOutsideZoneNgxsExecutionStrategy as ɵx };
4548
+ export { Action, Actions, InitState, NGXS_PLUGINS, NgxsModule, NgxsSimpleChange, NoopNgxsExecutionStrategy, Select, Selector, SelectorOptions, State, StateStream, StateToken, Store, UpdateState, actionMatcher, createSelector, ensureSelectorMetadata$1 as ensureSelectorMetadata, ensureStoreMetadata$1 as ensureStoreMetadata, getActionTypeFromInstance, getSelectorMetadata$1 as getSelectorMetadata, getStoreMetadata$1 as getStoreMetadata, getValue, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, setValue, OrderedSubject as ɵa, InternalActions as ɵb, ROOT_STATE_TOKEN as ɵc, FEATURE_STATE_TOKEN as ɵd, SELECTOR_META_KEY as ɵe, NgxsConfig as ɵf, mergeDeep as ɵg, USER_PROVIDED_NGXS_EXECUTION_STRATEGY as ɵh, NGXS_EXECUTION_STRATEGY as ɵi, NgxsRootModule as ɵj, StateFactory as ɵk, InternalDispatchedActionResults as ɵl, InternalDispatcher as ɵm, StateContextFactory as ɵn, InternalStateOperations as ɵo, PluginManager as ɵp, InternalNgxsExecutionStrategy as ɵq, ensureStoreMetadata as ɵs, getStoreMetadata as ɵt, ensureSelectorMetadata as ɵu, getSelectorMetadata as ɵv, LifecycleStateManager as ɵw, NgxsFeatureModule as ɵx };
4526
4549
  //# sourceMappingURL=ngxs-store.js.map