@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,4 +1,4 @@
1
- import { NgZone, Injectable, Inject, PLATFORM_ID, InjectionToken, Optional, SkipSelf, ErrorHandler, Injector, defineInjectable, inject, ɵivyEnabled, NgModule, APP_BOOTSTRAP_LISTENER } from '@angular/core';
1
+ import { NgZone, Injectable, Inject, PLATFORM_ID, defineInjectable, inject, InjectionToken, INJECTOR, ɵglobal, Optional, SkipSelf, ErrorHandler, Injector, ɵivyEnabled, NgModule, APP_BOOTSTRAP_LISTENER } from '@angular/core';
2
2
  import { isAngularInTestMode, memoize, INITIAL_STATE_TOKEN, NgxsBootstrapper, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, InitialState, ensureInjectorNotifierIsCaptured, localInject, ensureLocalInjectorCaptured } from '@ngxs/store/internals';
3
3
  import { isPlatformServer } from '@angular/common';
4
4
  import { Observable, Subject, BehaviorSubject, of, forkJoin, throwError, EMPTY, from } from 'rxjs';
@@ -146,13 +146,14 @@ class DispatchOutsideZoneNgxsExecutionStrategy {
146
146
  }
147
147
  }
148
148
  DispatchOutsideZoneNgxsExecutionStrategy.decorators = [
149
- { type: Injectable }
149
+ { type: Injectable, args: [{ providedIn: 'root' },] }
150
150
  ];
151
151
  /** @nocollapse */
152
152
  DispatchOutsideZoneNgxsExecutionStrategy.ctorParameters = () => [
153
153
  { type: NgZone },
154
154
  { type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
155
155
  ];
156
+ /** @nocollapse */ DispatchOutsideZoneNgxsExecutionStrategy.ngInjectableDef = defineInjectable({ factory: function DispatchOutsideZoneNgxsExecutionStrategy_Factory() { return new DispatchOutsideZoneNgxsExecutionStrategy(inject(NgZone), inject(PLATFORM_ID)); }, token: DispatchOutsideZoneNgxsExecutionStrategy, providedIn: "root" });
156
157
  if (false) {
157
158
  /**
158
159
  * @type {?}
@@ -403,11 +404,59 @@ if (false) {
403
404
  * @fileoverview added by tsickle
404
405
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
405
406
  */
407
+ class NoopNgxsExecutionStrategy {
408
+ /**
409
+ * @template T
410
+ * @param {?} func
411
+ * @return {?}
412
+ */
413
+ enter(func) {
414
+ return func();
415
+ }
416
+ /**
417
+ * @template T
418
+ * @param {?} func
419
+ * @return {?}
420
+ */
421
+ leave(func) {
422
+ return func();
423
+ }
424
+ }
425
+ NoopNgxsExecutionStrategy.decorators = [
426
+ { type: Injectable, args: [{ providedIn: 'root' },] }
427
+ ];
428
+ /** @nocollapse */ NoopNgxsExecutionStrategy.ngInjectableDef = defineInjectable({ factory: function NoopNgxsExecutionStrategy_Factory() { return new NoopNgxsExecutionStrategy(); }, token: NoopNgxsExecutionStrategy, providedIn: "root" });
429
+
430
+ /**
431
+ * @fileoverview added by tsickle
432
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
433
+ */
434
+ /**
435
+ * The strategy that might be provided by users through `options.executionStrategy`.
436
+ * @type {?}
437
+ */
438
+ const USER_PROVIDED_NGXS_EXECUTION_STRATEGY = new InjectionToken('USER_PROVIDED_NGXS_EXECUTION_STRATEGY');
406
439
  /*
407
440
  * Internal execution strategy injection token
408
441
  */
409
442
  /** @type {?} */
410
- const NGXS_EXECUTION_STRATEGY = new InjectionToken('NGXS_EXECUTION_STRATEGY');
443
+ const NGXS_EXECUTION_STRATEGY = new InjectionToken('NGXS_EXECUTION_STRATEGY', {
444
+ providedIn: 'root',
445
+ factory: (/**
446
+ * @return {?}
447
+ */
448
+ () => {
449
+ /** @type {?} */
450
+ const injector = inject(INJECTOR);
451
+ /** @type {?} */
452
+ const executionStrategy = injector.get(USER_PROVIDED_NGXS_EXECUTION_STRATEGY);
453
+ return executionStrategy
454
+ ? injector.get(executionStrategy)
455
+ : injector.get(typeof ɵglobal.Zone !== 'undefined'
456
+ ? DispatchOutsideZoneNgxsExecutionStrategy
457
+ : NoopNgxsExecutionStrategy);
458
+ })
459
+ });
411
460
  /**
412
461
  * @record
413
462
  */
@@ -3394,8 +3443,8 @@ class NgxsModule {
3394
3443
  static ngxsTokenProviders(states, options) {
3395
3444
  return [
3396
3445
  {
3397
- provide: NGXS_EXECUTION_STRATEGY,
3398
- useClass: options.executionStrategy || DispatchOutsideZoneNgxsExecutionStrategy
3446
+ provide: USER_PROVIDED_NGXS_EXECUTION_STRATEGY,
3447
+ useValue: options.executionStrategy
3399
3448
  },
3400
3449
  {
3401
3450
  provide: ROOT_STATE_TOKEN,
@@ -3938,32 +3987,6 @@ function Selector(selectors) {
3938
3987
  });
3939
3988
  }
3940
3989
 
3941
- /**
3942
- * @fileoverview added by tsickle
3943
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3944
- */
3945
- class NoopNgxsExecutionStrategy {
3946
- /**
3947
- * @template T
3948
- * @param {?} func
3949
- * @return {?}
3950
- */
3951
- enter(func) {
3952
- return func();
3953
- }
3954
- /**
3955
- * @template T
3956
- * @param {?} func
3957
- * @return {?}
3958
- */
3959
- leave(func) {
3960
- return func();
3961
- }
3962
- }
3963
- NoopNgxsExecutionStrategy.decorators = [
3964
- { type: Injectable }
3965
- ];
3966
-
3967
3990
  /**
3968
3991
  * @fileoverview added by tsickle
3969
3992
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -4028,5 +4051,5 @@ if (false) {
4028
4051
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4029
4052
  */
4030
4053
 
4031
- 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 };
4054
+ 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 };
4032
4055
  //# sourceMappingURL=ngxs-store.js.map