@ngxs/store 3.7.3-dev.master-cdd7ae3 → 3.7.3-dev.master-69553aa

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.
@@ -4,6 +4,73 @@
4
4
  (global = global || self, factory((global.ngxs = global.ngxs || {}, global.ngxs.store = global.ngxs.store || {}, global.ngxs.store.internals = {}), global.ng.core, global.rxjs));
5
5
  }(this, function (exports, core, rxjs) { 'use strict';
6
6
 
7
+ /**
8
+ * @fileoverview added by tsickle
9
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
10
+ */
11
+ /**
12
+ * @return {?}
13
+ */
14
+ function isAngularInTestMode() {
15
+ return (typeof core.ɵglobal.__karma__ !== 'undefined' ||
16
+ typeof core.ɵglobal.jasmine !== 'undefined' ||
17
+ typeof core.ɵglobal.jest !== 'undefined' ||
18
+ typeof core.ɵglobal.Mocha !== 'undefined');
19
+ }
20
+
21
+ /**
22
+ * @fileoverview added by tsickle
23
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
24
+ */
25
+ var NgxsBootstrapper = /** @class */ (function () {
26
+ function NgxsBootstrapper() {
27
+ /**
28
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
29
+ */
30
+ this.bootstrap$ = new rxjs.ReplaySubject(1);
31
+ }
32
+ Object.defineProperty(NgxsBootstrapper.prototype, "appBootstrapped$", {
33
+ get: /**
34
+ * @return {?}
35
+ */
36
+ function () {
37
+ return this.bootstrap$.asObservable();
38
+ },
39
+ enumerable: true,
40
+ configurable: true
41
+ });
42
+ /**
43
+ * This event will be emitted after attaching `ComponentRef` of the root component
44
+ * to the tree of views, that's a signal that application has been fully rendered
45
+ */
46
+ /**
47
+ * This event will be emitted after attaching `ComponentRef` of the root component
48
+ * to the tree of views, that's a signal that application has been fully rendered
49
+ * @return {?}
50
+ */
51
+ NgxsBootstrapper.prototype.bootstrap = /**
52
+ * This event will be emitted after attaching `ComponentRef` of the root component
53
+ * to the tree of views, that's a signal that application has been fully rendered
54
+ * @return {?}
55
+ */
56
+ function () {
57
+ this.bootstrap$.next(true);
58
+ this.bootstrap$.complete();
59
+ };
60
+ NgxsBootstrapper.decorators = [
61
+ { type: core.Injectable }
62
+ ];
63
+ return NgxsBootstrapper;
64
+ }());
65
+ if (false) {
66
+ /**
67
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
68
+ * @type {?}
69
+ * @private
70
+ */
71
+ NgxsBootstrapper.prototype.bootstrap$;
72
+ }
73
+
7
74
  /**
8
75
  * @fileoverview added by tsickle
9
76
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -75,103 +142,6 @@
75
142
  return (/** @type {?} */ (memoized));
76
143
  }
77
144
 
78
- /**
79
- * @fileoverview added by tsickle
80
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
81
- */
82
- /**
83
- * @return {?}
84
- */
85
- function _isAngularInTestMode() {
86
- /** @type {?} */
87
- var platformRef = core.getPlatform();
88
- if (!platformRef)
89
- return false;
90
- /** @type {?} */
91
- var compilerOptions = platformRef.injector.get(core.COMPILER_OPTIONS, null);
92
- if (!compilerOptions)
93
- return false;
94
- /** @type {?} */
95
- var isInTestMode = compilerOptions.some((/**
96
- * @param {?} item
97
- * @return {?}
98
- */
99
- function (item) {
100
- /** @type {?} */
101
- var providers = (item && item.providers) || [];
102
- return providers.some((/**
103
- * @param {?} provider
104
- * @return {?}
105
- */
106
- function (provider) {
107
- return ((provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||
108
- false);
109
- }));
110
- }));
111
- return isInTestMode;
112
- }
113
- /** @type {?} */
114
- var isAngularInTestMode =
115
- // Caretaker note: we have still left the `typeof` condition in order to avoid
116
- // creating a breaking change for projects that still use the View Engine.
117
- typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : (/**
118
- * @return {?}
119
- */
120
- function () { return false; });
121
-
122
- /**
123
- * @fileoverview added by tsickle
124
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
125
- */
126
- var NgxsBootstrapper = /** @class */ (function () {
127
- function NgxsBootstrapper() {
128
- /**
129
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
130
- */
131
- this.bootstrap$ = new rxjs.ReplaySubject(1);
132
- }
133
- Object.defineProperty(NgxsBootstrapper.prototype, "appBootstrapped$", {
134
- get: /**
135
- * @return {?}
136
- */
137
- function () {
138
- return this.bootstrap$.asObservable();
139
- },
140
- enumerable: true,
141
- configurable: true
142
- });
143
- /**
144
- * This event will be emitted after attaching `ComponentRef` of the root component
145
- * to the tree of views, that's a signal that application has been fully rendered
146
- */
147
- /**
148
- * This event will be emitted after attaching `ComponentRef` of the root component
149
- * to the tree of views, that's a signal that application has been fully rendered
150
- * @return {?}
151
- */
152
- NgxsBootstrapper.prototype.bootstrap = /**
153
- * This event will be emitted after attaching `ComponentRef` of the root component
154
- * to the tree of views, that's a signal that application has been fully rendered
155
- * @return {?}
156
- */
157
- function () {
158
- this.bootstrap$.next(true);
159
- this.bootstrap$.complete();
160
- };
161
- NgxsBootstrapper.decorators = [
162
- { type: core.Injectable }
163
- ];
164
- return NgxsBootstrapper;
165
- }());
166
- if (false) {
167
- /**
168
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
169
- * @type {?}
170
- * @private
171
- */
172
- NgxsBootstrapper.prototype.bootstrap$;
173
- }
174
-
175
145
  /**
176
146
  * @fileoverview added by tsickle
177
147
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -1 +1 @@
1
- {"version":3,"file":"ngxs-store-internals.umd.js","sources":["ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { getPlatform, COMPILER_OPTIONS, CompilerOptions, PlatformRef } from '@angular/core';\nimport { memoize } from './memoize';\n\n/**\n * @description Will be provided through Terser global definitions by Angular CLI\n * during the production build. This is how Angular does tree-shaking internally.\n */\ndeclare const ngDevMode: boolean;\n\nfunction _isAngularInTestMode(): boolean {\n const platformRef: PlatformRef | null = getPlatform();\n if (!platformRef) return false;\n const compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);\n if (!compilerOptions) return false;\n const isInTestMode = compilerOptions.some((item: CompilerOptions) => {\n const providers = (item && item.providers) || [];\n return providers.some((provider: any) => {\n return (\n (provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||\n false\n );\n });\n });\n return isInTestMode;\n}\n\nexport const isAngularInTestMode =\n // Caretaker note: we have still left the `typeof` condition in order to avoid\n // creating a breaking change for projects that still use the View Engine.\n typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : () => false;\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":["getPlatform","COMPILER_OPTIONS","ReplaySubject","Injectable","InjectionToken","ɵɵdirectiveInject","INJECTOR","ɵglobal"],"mappings":";;;;;;;;;;;;;;;IAAA,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;QAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;KAChB;;;;;;;IAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1C,IAAuB,EACvB,IAAuB;QAEvB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;YACjE,OAAO,KAAK,CAAC;SACd;;;YAGK,MAAM,GAAG,IAAI,CAAC,MAAM;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAA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ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["import { ɵglobal } from '@angular/core';\n\nexport function isAngularInTestMode(): boolean {\n return (\n typeof ɵglobal.__karma__ !== 'undefined' ||\n typeof ɵglobal.jasmine !== 'undefined' ||\n typeof ɵglobal.jest !== 'undefined' ||\n typeof ɵglobal.Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":["ɵglobal","ReplaySubject","Injectable","InjectionToken","ɵɵdirectiveInject","INJECTOR"],"mappings":";;;;;;;;;;IAAA;;;IAEA,SAAgB,mBAAmB;QACjC,QACE,OAAOA,YAAO,CAAC,SAAS,KAAK,WAAW;YACxC,OAAOA,YAAO,CAAC,OAAO,KAAK,WAAW;YACtC,OAAOA,YAAO,CAAC,IAAI,KAAK,WAAW;YACnC,OAAOA,YAAO,CAAC,KAAK,KAAK,WAAW,EACpC;KACH;;;;;;ACTD;QAGA;;;;YAKU,eAAU,GAAG,IAAIC,kBAAa,CAAU,CAAC,CAAC,CAAC;SAcpD;QAZC,sBAAI,8CAAgB;;;;YAApB;gBACE,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;aACvC;;;WAAA;;;;;;;;;;QAMD,oCAAS;;;;;QAAT;YACE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;SAC5B;;oBAlBFC,eAAU;;QAmBX,uBAAC;KAnBD,IAmBC;;;;;;;QAdC,sCAAmD;;;;;;;;;;;;ICRrD,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;QAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;KAChB;;;;;;;IAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1C,IAAuB,EACvB,IAAuB;QAEvB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KA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xBA,YAAO,CAAC,OAAO,CAAC,QAAQ;;;gBAAC;oBACvB,eAAe,CAAC,WAAW,CAAC,CAAC;iBAC9B,EAAC,CAAC;SACN;KACF;;;;IAQD,yBAEC;;;QADC,6BAAwB;;;;;IAG1B,kDAUC;;;QARC,oDAAmB;;QAEnB,oDAAmB;;QAEnB,mDAAkB;;QAElB,mDAAkB;;;;;;;IAIpB,8BAGC;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs")):"function"==typeof define&&define.amd?define("@ngxs/store/internals",["exports","@angular/core","rxjs"],t):t(((e=e||self).ngxs=e.ngxs||{},e.ngxs.store=e.ngxs.store||{},e.ngxs.store.internals={}),e.ng.core,e.rxjs)}(this,(function(e,t,n){"use strict";function r(e,t){return e===t}function o(e,t){void 0===t&&(t=r);var n=null,o=null;function u(){return function(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}(t,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}return u.reset=function(){n=null,o=null},u}var u="undefined"==typeof ngDevMode||ngDevMode?o((function(){var e=t.getPlatform();if(!e)return!1;var n=e.injector.get(t.COMPILER_OPTIONS,null);return!!n&&n.some((function(e){return(e&&e.providers||[]).some((function(e){return e&&e.provide&&"MockNgModuleResolver"===e.provide.name||!1}))}))})):function(){return!1},i=function(){function e(){this.bootstrap$=new n.ReplaySubject(1)}return Object.defineProperty(e.prototype,"appBootstrapped$",{get:function(){return this.bootstrap$.asObservable()},enumerable:!0,configurable:!0}),e.prototype.bootstrap=function(){this.bootstrap$.next(!0),this.bootstrap$.complete()},e.decorators=[{type:t.Injectable}],e}();var c=new t.InjectionToken("INITIAL_STATE_TOKEN"),a=function(){function e(){}return e.set=function(e){this.value=e},e.pop=function(){var e=this.value;return this.value={},e},e.value={},e}();var s=new t.InjectionToken("Internals.StateContextFactory"),l=new t.InjectionToken("Internals.StateFactory"),f="ɵfac",p=Symbol("InjectorInstance"),v=Symbol("FactoryHasBeenDecorated"),d=Symbol("InjectorNotifier");function g(e){var n=e[f];if("function"==typeof n){var r=e.ɵprov||e.ɵpipe||e.ɵcmp||e.ɵdir,o=function(){var e=n();e[p]=t.ɵɵdirectiveInject(t.INJECTOR);var r=e[d];return r&&(r.next(!0),r.complete()),e};r&&(r.factory=o),Object.defineProperty(e,f,{get:function(){return o}})}}e.INITIAL_STATE_TOKEN=c,e.InitialState=a,e.NGXS_STATE_CONTEXT_FACTORY=s,e.NGXS_STATE_FACTORY=l,e.NgxsBootstrapper=i,e.ensureInjectorNotifierIsCaptured=function(e){if(e[d])return e[d];var t=new n.ReplaySubject(1);return Object.defineProperty(e,d,{get:function(){return t}}),t},e.ensureLocalInjectorCaptured=function(e){if(!(v in e.constructor.prototype)){var n=e.constructor;"function"==typeof n[f]?g(n):ngDevMode&&function(e){try{Promise.resolve().then((function(){g(e)}))}catch(n){t.ɵglobal.process&&t.ɵglobal.process.nextTick&&t.ɵglobal.process.nextTick((function(){g(e)}))}}(n),e.constructor.prototype[v]=!0}},e.isAngularInTestMode=u,e.localInject=function(e,t){var n=e[p];return n?n.get(t):null},e.memoize=o,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs")):"function"==typeof define&&define.amd?define("@ngxs/store/internals",["exports","@angular/core","rxjs"],t):t(((e=e||self).ngxs=e.ngxs||{},e.ngxs.store=e.ngxs.store||{},e.ngxs.store.internals={}),e.ng.core,e.rxjs)}(this,(function(e,t,n){"use strict";var o=function(){function e(){this.bootstrap$=new n.ReplaySubject(1)}return Object.defineProperty(e.prototype,"appBootstrapped$",{get:function(){return this.bootstrap$.asObservable()},enumerable:!0,configurable:!0}),e.prototype.bootstrap=function(){this.bootstrap$.next(!0),this.bootstrap$.complete()},e.decorators=[{type:t.Injectable}],e}();function r(e,t){return e===t}var i=new t.InjectionToken("INITIAL_STATE_TOKEN"),c=function(){function e(){}return e.set=function(e){this.value=e},e.pop=function(){var e=this.value;return this.value={},e},e.value={},e}();var u=new t.InjectionToken("Internals.StateContextFactory"),a=new t.InjectionToken("Internals.StateFactory"),l="ɵfac",s=Symbol("InjectorInstance"),f=Symbol("FactoryHasBeenDecorated"),p=Symbol("InjectorNotifier");function v(e){var n=e[l];if("function"==typeof n){var o=e.ɵprov||e.ɵpipe||e.ɵcmp||e.ɵdir,r=function(){var e=n();e[s]=t.ɵɵdirectiveInject(t.INJECTOR);var o=e[p];return o&&(o.next(!0),o.complete()),e};o&&(o.factory=r),Object.defineProperty(e,l,{get:function(){return r}})}}e.INITIAL_STATE_TOKEN=i,e.InitialState=c,e.NGXS_STATE_CONTEXT_FACTORY=u,e.NGXS_STATE_FACTORY=a,e.NgxsBootstrapper=o,e.ensureInjectorNotifierIsCaptured=function(e){if(e[p])return e[p];var t=new n.ReplaySubject(1);return Object.defineProperty(e,p,{get:function(){return t}}),t},e.ensureLocalInjectorCaptured=function(e){if(!(f in e.constructor.prototype)){var n=e.constructor;"function"==typeof n[l]?v(n):ngDevMode&&function(e){try{Promise.resolve().then((function(){v(e)}))}catch(n){t.ɵglobal.process&&t.ɵglobal.process.nextTick&&t.ɵglobal.process.nextTick((function(){v(e)}))}}(n),e.constructor.prototype[f]=!0}},e.isAngularInTestMode=function(){return void 0!==t.ɵglobal.__karma__||void 0!==t.ɵglobal.jasmine||void 0!==t.ɵglobal.jest||void 0!==t.ɵglobal.Mocha},e.localInject=function(e,t){var n=e[s];return n?n.get(t):null},e.memoize=function(e,t){void 0===t&&(t=r);var n=null,o=null;function i(){return function(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var o=t.length,r=0;r<o;r++)if(!e(t[r],n[r]))return!1;return!0}(t,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}return i.reset=function(){n=null,o=null},i},Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=ngxs-store-internals.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"names":["defaultEqualityCheck","a","b","memoize","func","equalityCheck","lastArgs","lastResult","memoized","prev","next","length","i","areArgumentsShallowlyEqual","arguments","apply","reset","isAngularInTestMode","ngDevMode","platformRef","getPlatform","compilerOptions","injector","get","COMPILER_OPTIONS","some","item","providers","provider","provide","name","NgxsBootstrapper","this","bootstrap$","ReplaySubject","Object","defineProperty","prototype","asObservable","bootstrap","complete","Injectable","INITIAL_STATE_TOKEN","InjectionToken","InitialState","set","state","value","pop","NGXS_STATE_CONTEXT_FACTORY","NGXS_STATE_FACTORY","NG_FACTORY_DEF","InjectorInstance","Symbol","FactoryHasBeenDecorated","InjectorNotifier","decorateFactory","constructor","factory","def","ɵprov","ɵpipe","ɵcmp","ɵdir","decoratedFactory","instance","ɵɵdirectiveInject","INJECTOR","injectorNotifier$","target","injectorNotifier$_1","Promise","resolve","then","_a","ɵglobal","process","nextTick","decorateFactoryLater","token"],"mappings":"iXAAA,SAASA,EAAqBC,EAAQC,GACpC,OAAOD,IAAMC,EA6Bf,SAAgBC,EACdC,EACAC,QAAA,IAAAA,IAAAA,EAAAL,OAEIM,EAA8B,KAC9BC,EAAkB,KAEtB,SAASC,IAOP,OAxCJ,SACEH,EACAI,EACAC,GAEA,GAAa,OAATD,GAA0B,OAATC,GAAiBD,EAAKE,SAAWD,EAAKC,OACzD,OAAO,EAKT,QADMA,EAASF,EAAKE,OACXC,EAAI,EAAGA,EAAID,EAAQC,IAC1B,IAAKP,EAAcI,EAAKG,GAAIF,EAAKE,IAC/B,OAAO,EAIX,OAAO,EAiBAC,CAA2BR,EA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,EAAYI,OAASJ,EAAYK,MAAQL,EAAYM,KAEhFC,EAAgB,eACdC,EAAWP,IAMjBO,EAASb,GAAoBc,EAAAA,kBAI3BC,EAAAA,cAIIC,EAAoBH,EAASV,GAMnC,OALIa,IACFA,EAAkB1D,MAAK,GACvB0D,EAAkB5B,YAGbyB,GAKLN,IACFA,EAAID,QAAUM,GAKhB7B,OAAOC,eAAeqB,EAAaN,EAAgB,CACjD5B,IAAG,WAAQ,OAAAyC,6JA1Ff,SACEK,GAEA,GAAIA,EAAOd,GACT,OAAOc,EAAOd,OAERe,EAAoB,IAAIpC,EAAAA,cAAuB,GAIrD,OAHAC,OAAOC,eAAeiC,EAAQd,EAAkB,CAC9ChC,IAAG,WAAQ,OAAA+C,KAENA,iCAKX,SAA4CD,GAC1C,KAAIf,KAA2Be,EAAOZ,YAAYpB,WAAlD,KAIMoB,EAAmDY,EAAOZ,YAErB,mBAAhCA,EAAYN,GACrBK,EAAgBC,GACPvC,WAsEb,SAA8BuC,GAK5B,IACEc,QAAQC,UAAUC,MAAI,WACpBjB,EAAgBC,MAElB,MAAAiB,GAGAC,EAAAA,QAAQC,SACND,EAAAA,QAAQC,QAAQC,UAChBF,EAAAA,QAAQC,QAAQC,UAAQ,WACtBrB,EAAgBC,OA9EpBqB,CAAqBrB,GAGvBY,EAAOZ,YAAYpB,UAAUiB,IAA2B,0CAG1D,SACEW,EACAc,OAEMzD,EAAiC2C,EAASb,GAChD,OAAO9B,EAAWA,EAASC,IAAIwD,GAAS","sourcesContent":["function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { getPlatform, COMPILER_OPTIONS, CompilerOptions, PlatformRef } from '@angular/core';\nimport { memoize } from './memoize';\n\n/**\n * @description Will be provided through Terser global definitions by Angular CLI\n * during the production build. This is how Angular does tree-shaking internally.\n */\ndeclare const ngDevMode: boolean;\n\nfunction _isAngularInTestMode(): boolean {\n const platformRef: PlatformRef | null = getPlatform();\n if (!platformRef) return false;\n const compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);\n if (!compilerOptions) return false;\n const isInTestMode = compilerOptions.some((item: CompilerOptions) => {\n const providers = (item && item.providers) || [];\n return providers.some((provider: any) => {\n return (\n (provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||\n false\n );\n });\n });\n return isInTestMode;\n}\n\nexport const isAngularInTestMode =\n // Caretaker note: we have still left the `typeof` condition in order to avoid\n // creating a breaking change for projects that still use the View Engine.\n typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : () => false;\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"]}
1
+ {"version":3,"sources":["ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts","ng://@ngxs/store/internals/angular.ts"],"names":["NgxsBootstrapper","this","bootstrap$","ReplaySubject","Object","defineProperty","prototype","asObservable","bootstrap","next","complete","Injectable","defaultEqualityCheck","a","b","INITIAL_STATE_TOKEN","InjectionToken","InitialState","set","state","value","pop","NGXS_STATE_CONTEXT_FACTORY","NGXS_STATE_FACTORY","NG_FACTORY_DEF","InjectorInstance","Symbol","FactoryHasBeenDecorated","InjectorNotifier","decorateFactory","constructor","factory","def","ɵprov","ɵpipe","ɵcmp","ɵdir","decoratedFactory","instance","ɵɵdirectiveInject","INJECTOR","injectorNotifier$","get","target","injectorNotifier$_1","ngDevMode","Promise","resolve","then","_a","ɵglobal","process","nextTick","decorateFactoryLater","__karma__","jasmine","jest","Mocha","token","injector","func","equalityCheck","lastArgs","lastResult","memoized","prev","length","i","areArgumentsShallowlyEqual","arguments","apply","reset"],"mappings":"iXAAA,IAAAA,EAAA,WAGA,SAAAA,IAKUC,KAAAC,WAAa,IAAIC,EAAAA,cAAuB,GAclD,OAZEC,OAAAC,eAAIL,EAAAM,UAAA,mBAAgB,KAApB,WACE,OAAOL,KAAKC,WAAWK,gDAOzBP,EAAAM,UAAAE,UAAA,WACEP,KAAKC,WAAWO,MAAK,GACrBR,KAAKC,WAAWQ,gCAjBnBC,EAAAA,aAmBDX,EAtBA,GCAA,SAASY,EAAqBC,EAAQC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SACND,EAAAA,QAAQC,QAAQC,UAChBF,EAAAA,QAAQC,QAAQC,UAAQ,WACtBvB,EAAgBC,OA9EpBuB,CAAqBvB,GAGvBa,EAAOb,YAAYxB,UAAUqB,IAA2B,0BC/D1D,WACE,YAC+B,IAAtBuB,EAAAA,QAAQI,gBACY,IAApBJ,EAAAA,QAAQK,cACS,IAAjBL,EAAAA,QAAQM,WACU,IAAlBN,EAAAA,QAAQO,qBD6DnB,SACEnB,EACAoB,OAEMC,EAAiCrB,EAASb,GAChD,OAAOkC,EAAWA,EAASjB,IAAIgB,GAAS,gBH3C1C,SACEE,EACAC,QAAA,IAAAA,IAAAA,EAAAjD,OAEIkD,EAA8B,KAC9BC,EAAkB,KAEtB,SAASC,IAOP,OAxCJ,SACEH,EACAI,EACAxD,GAEA,GAAa,OAATwD,GAA0B,OAATxD,GAAiBwD,EAAKC,SAAWzD,EAAKyD,OACzD,OAAO,EAKT,QADMA,EAASD,EAAKC,OACXC,EAAI,EAAGA,EAAID,EAAQC,IAC1B,IAAKN,EAAcI,EAAKE,GAAI1D,EAAK0D,IAC/B,OAAO,EAIX,OAAO,EAiBAC,CAA2BP,EAAeC,EAAUO,aAEvDN,EAAa,EAAiBO,MAAM,KAAMD,YAG5CP,EAAWO,UACJN,EAOT,OALA,EAAgBQ,MAAK,WAEnBT,EAAW,KACXC,EAAa,MAEf","sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n","import { ɵglobal } from '@angular/core';\n\nexport function isAngularInTestMode(): boolean {\n return (\n typeof ɵglobal.__karma__ !== 'undefined' ||\n typeof ɵglobal.jasmine !== 'undefined' ||\n typeof ɵglobal.jest !== 'undefined' ||\n typeof ɵglobal.Mocha !== 'undefined'\n );\n}\n"]}
@@ -2,45 +2,14 @@
2
2
  * @fileoverview added by tsickle
3
3
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
4
  */
5
- import { getPlatform, COMPILER_OPTIONS } from '@angular/core';
6
- import { memoize } from './memoize';
5
+ import { ɵglobal } from '@angular/core';
7
6
  /**
8
7
  * @return {?}
9
8
  */
10
- function _isAngularInTestMode() {
11
- /** @type {?} */
12
- const platformRef = getPlatform();
13
- if (!platformRef)
14
- return false;
15
- /** @type {?} */
16
- const compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);
17
- if (!compilerOptions)
18
- return false;
19
- /** @type {?} */
20
- const isInTestMode = compilerOptions.some((/**
21
- * @param {?} item
22
- * @return {?}
23
- */
24
- (item) => {
25
- /** @type {?} */
26
- const providers = (item && item.providers) || [];
27
- return providers.some((/**
28
- * @param {?} provider
29
- * @return {?}
30
- */
31
- (provider) => {
32
- return ((provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||
33
- false);
34
- }));
35
- }));
36
- return isInTestMode;
9
+ export function isAngularInTestMode() {
10
+ return (typeof ɵglobal.__karma__ !== 'undefined' ||
11
+ typeof ɵglobal.jasmine !== 'undefined' ||
12
+ typeof ɵglobal.jest !== 'undefined' ||
13
+ typeof ɵglobal.Mocha !== 'undefined');
37
14
  }
38
- /** @type {?} */
39
- export const isAngularInTestMode =
40
- // Caretaker note: we have still left the `typeof` condition in order to avoid
41
- // creating a breaking change for projects that still use the View Engine.
42
- typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : (/**
43
- * @return {?}
44
- */
45
- () => false);
46
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3hzL3N0b3JlL2ludGVybmFscy8iLCJzb3VyY2VzIjpbImFuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsZ0JBQWdCLEVBQWdDLE1BQU0sZUFBZSxDQUFDO0FBQzVGLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxXQUFXLENBQUM7Ozs7QUFRcEMsU0FBUyxvQkFBb0I7O1VBQ3JCLFdBQVcsR0FBdUIsV0FBVyxFQUFFO0lBQ3JELElBQUksQ0FBQy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b24gaXNBbmd1bGFySW5UZXN0TW9kZSgpOiBib29sZWFuIHtcbiAgcmV0dXJuIChcbiAgICB0eXBlb2YgybVnbG9iYWwuX19rYXJtYV9fICE9PSAndW5kZWZpbmVkJyB8fFxuICAgIHR5cGVvZiDJtWdsb2JhbC5qYXNtaW5lICE9PSAndW5kZWZpbmVkJyB8fFxuICAgIHR5cGVvZiDJtWdsb2JhbC5qZXN0ICE9PSAndW5kZWZpbmVkJyB8fFxuICAgIHR5cGVvZiDJtWdsb2JhbC5Nb2NoYSAhPT0gJ3VuZGVmaW5lZCdcbiAgKTtcbn1cbiJdfQ==
@@ -2,45 +2,14 @@
2
2
  * @fileoverview added by tsickle
3
3
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4
4
  */
5
- import { getPlatform, COMPILER_OPTIONS } from '@angular/core';
6
- import { memoize } from './memoize';
5
+ import { ɵglobal } from '@angular/core';
7
6
  /**
8
7
  * @return {?}
9
8
  */
10
- function _isAngularInTestMode() {
11
- /** @type {?} */
12
- var platformRef = getPlatform();
13
- if (!platformRef)
14
- return false;
15
- /** @type {?} */
16
- var compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);
17
- if (!compilerOptions)
18
- return false;
19
- /** @type {?} */
20
- var isInTestMode = compilerOptions.some((/**
21
- * @param {?} item
22
- * @return {?}
23
- */
24
- function (item) {
25
- /** @type {?} */
26
- var providers = (item && item.providers) || [];
27
- return providers.some((/**
28
- * @param {?} provider
29
- * @return {?}
30
- */
31
- function (provider) {
32
- return ((provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||
33
- false);
34
- }));
35
- }));
36
- return isInTestMode;
9
+ export function isAngularInTestMode() {
10
+ return (typeof ɵglobal.__karma__ !== 'undefined' ||
11
+ typeof ɵglobal.jasmine !== 'undefined' ||
12
+ typeof ɵglobal.jest !== 'undefined' ||
13
+ typeof ɵglobal.Mocha !== 'undefined');
37
14
  }
38
- /** @type {?} */
39
- export var isAngularInTestMode =
40
- // Caretaker note: we have still left the `typeof` condition in order to avoid
41
- // creating a breaking change for projects that still use the View Engine.
42
- typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : (/**
43
- * @return {?}
44
- */
45
- function () { return false; });
46
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3hzL3N0b3JlL2ludGVybmFscy8iLCJzb3VyY2VzIjpbImFuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsZ0JBQWdCLEVBQWdDLE1BQU0sZUFBZSxDQUFDO0FBQzVGLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxXQUFXLENBQUM7Ozs7QUFRcEMsU0FBUyxvQkFBb0I7O1FBQ3JCLFdBQVcsR0FBdUIsV0FBVyxFQUFFO0lBQ3JELElBQUksQ0FBQyxXQUFXO1FBQUUsT0FBTyxLQUFLLENBQUM7O1FBQ3pCLGVBQWUsR0FBRyxXQUFXLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxnQkFBZ0IsRUFBRSxJQUFJLENBQUM7SUFDeEUsSUFBSSxDQUFDLGVBQWU7UUFBRSxPQUFPLEtBQUssQ0FBQzs7UUFDN0IsWUFBWSxHQUFHLGVBQWUsQ0FBQyxJQUFJOzs7O0lBQUMsVUFBQyxJQUFxQjs7WUFDeEQsU0FBUyxHQUFHLENBQUMsSUFBSSxJQUFJLElBQUksQ0FBQyxTQUFTLENBQUMsSUFBSSxFQUFFO1FBQ2hELE9BQU8sU0FBUyxDQUFDLElBQUk7Ozs7UUFBQyxVQUFDLFFBQWE7WUFDbEMsT0FBTyxDQUNMLENBQUMsUUFBUSxJQUFJLFFBQVEsQ0FBQyxPQUFPLElBQUksUUFBUSxDQUFDLE9BQU8sQ0FBQyx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ovL0BuZ3hzL3N0b3JlL2ludGVybmFscy8iLCJzb3VyY2VzIjpbImFuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxlQUFlLENBQUM7Ozs7QUFFeEMsTUFBTSxVQUFVLG1CQUFtQjtJQUNqQyxPQUFPLENBQ0wsT0FBTyxPQUFPLENBQUMsU0FBUyxLQUFLLFdBQVc7UUFDeEMsT0FBTyxPQUFPLENBQUMsT0FBTyxLQUFLLFdBQVc7UUFDdEMsT0FBTyxPQUFPLENBQUMsSUFBSSxLQUFLLFdBQVc7UUFDbkMsT0FBTyxPQUFPLENBQUMsS0FBSyxLQUFLLFdBQVcsQ0FDckMsQ0FBQztBQUNKLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyDJtWdsb2JhbCB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5leHBvcnQgZnVuY3Rpb24gaXNBbmd1bGFySW5UZXN0TW9kZSgpOiBib29sZWFuIHtcbiAgcmV0dXJuIChcbiAgICB0eXBlb2YgybVnbG9iYWwuX19rYXJtYV9fICE9PSAndW5kZWZpbmVkJyB8fFxuICAgIHR5cGVvZiDJtWdsb2JhbC5qYXNtaW5lICE9PSAndW5kZWZpbmVkJyB8fFxuICAgIHR5cGVvZiDJtWdsb2JhbC5qZXN0ICE9PSAndW5kZWZpbmVkJyB8fFxuICAgIHR5cGVvZiDJtWdsb2JhbC5Nb2NoYSAhPT0gJ3VuZGVmaW5lZCdcbiAgKTtcbn1cbiJdfQ==
@@ -1,6 +1,59 @@
1
- import { getPlatform, COMPILER_OPTIONS, Injectable, InjectionToken, ɵɵdirectiveInject, INJECTOR, ɵglobal } from '@angular/core';
1
+ import { ɵglobal, Injectable, InjectionToken, ɵɵdirectiveInject, INJECTOR } from '@angular/core';
2
2
  import { ReplaySubject } from 'rxjs';
3
3
 
4
+ /**
5
+ * @fileoverview added by tsickle
6
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7
+ */
8
+ /**
9
+ * @return {?}
10
+ */
11
+ function isAngularInTestMode() {
12
+ return (typeof ɵglobal.__karma__ !== 'undefined' ||
13
+ typeof ɵglobal.jasmine !== 'undefined' ||
14
+ typeof ɵglobal.jest !== 'undefined' ||
15
+ typeof ɵglobal.Mocha !== 'undefined');
16
+ }
17
+
18
+ /**
19
+ * @fileoverview added by tsickle
20
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
21
+ */
22
+ class NgxsBootstrapper {
23
+ constructor() {
24
+ /**
25
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
26
+ */
27
+ this.bootstrap$ = new ReplaySubject(1);
28
+ }
29
+ /**
30
+ * @return {?}
31
+ */
32
+ get appBootstrapped$() {
33
+ return this.bootstrap$.asObservable();
34
+ }
35
+ /**
36
+ * This event will be emitted after attaching `ComponentRef` of the root component
37
+ * to the tree of views, that's a signal that application has been fully rendered
38
+ * @return {?}
39
+ */
40
+ bootstrap() {
41
+ this.bootstrap$.next(true);
42
+ this.bootstrap$.complete();
43
+ }
44
+ }
45
+ NgxsBootstrapper.decorators = [
46
+ { type: Injectable }
47
+ ];
48
+ if (false) {
49
+ /**
50
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
51
+ * @type {?}
52
+ * @private
53
+ */
54
+ NgxsBootstrapper.prototype.bootstrap$;
55
+ }
56
+
4
57
  /**
5
58
  * @fileoverview added by tsickle
6
59
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -71,89 +124,6 @@ function memoize(func, equalityCheck = defaultEqualityCheck) {
71
124
  return (/** @type {?} */ (memoized));
72
125
  }
73
126
 
74
- /**
75
- * @fileoverview added by tsickle
76
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
77
- */
78
- /**
79
- * @return {?}
80
- */
81
- function _isAngularInTestMode() {
82
- /** @type {?} */
83
- const platformRef = getPlatform();
84
- if (!platformRef)
85
- return false;
86
- /** @type {?} */
87
- const compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);
88
- if (!compilerOptions)
89
- return false;
90
- /** @type {?} */
91
- const isInTestMode = compilerOptions.some((/**
92
- * @param {?} item
93
- * @return {?}
94
- */
95
- (item) => {
96
- /** @type {?} */
97
- const providers = (item && item.providers) || [];
98
- return providers.some((/**
99
- * @param {?} provider
100
- * @return {?}
101
- */
102
- (provider) => {
103
- return ((provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||
104
- false);
105
- }));
106
- }));
107
- return isInTestMode;
108
- }
109
- /** @type {?} */
110
- const isAngularInTestMode =
111
- // Caretaker note: we have still left the `typeof` condition in order to avoid
112
- // creating a breaking change for projects that still use the View Engine.
113
- typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : (/**
114
- * @return {?}
115
- */
116
- () => false);
117
-
118
- /**
119
- * @fileoverview added by tsickle
120
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
121
- */
122
- class NgxsBootstrapper {
123
- constructor() {
124
- /**
125
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
126
- */
127
- this.bootstrap$ = new ReplaySubject(1);
128
- }
129
- /**
130
- * @return {?}
131
- */
132
- get appBootstrapped$() {
133
- return this.bootstrap$.asObservable();
134
- }
135
- /**
136
- * This event will be emitted after attaching `ComponentRef` of the root component
137
- * to the tree of views, that's a signal that application has been fully rendered
138
- * @return {?}
139
- */
140
- bootstrap() {
141
- this.bootstrap$.next(true);
142
- this.bootstrap$.complete();
143
- }
144
- }
145
- NgxsBootstrapper.decorators = [
146
- { type: Injectable }
147
- ];
148
- if (false) {
149
- /**
150
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
151
- * @type {?}
152
- * @private
153
- */
154
- NgxsBootstrapper.prototype.bootstrap$;
155
- }
156
-
157
127
  /**
158
128
  * @fileoverview added by tsickle
159
129
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -1 +1 @@
1
- {"version":3,"file":"ngxs-store-internals.js","sources":["ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { getPlatform, COMPILER_OPTIONS, CompilerOptions, PlatformRef } from '@angular/core';\nimport { memoize } from './memoize';\n\n/**\n * @description Will be provided through Terser global definitions by Angular CLI\n * during the production build. This is how Angular does tree-shaking internally.\n */\ndeclare const ngDevMode: boolean;\n\nfunction _isAngularInTestMode(): boolean {\n const platformRef: PlatformRef | null = getPlatform();\n if (!platformRef) return false;\n const compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);\n if (!compilerOptions) return false;\n const isInTestMode = compilerOptions.some((item: CompilerOptions) => {\n const providers = (item && item.providers) || [];\n return providers.some((provider: any) => {\n return (\n (provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||\n false\n );\n });\n });\n return isInTestMode;\n}\n\nexport const isAngularInTestMode =\n // Caretaker note: we have still left the `typeof` condition in order to avoid\n // creating a breaking change for projects that still use the View Engine.\n typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : () => false;\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;IAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;CAChB;;;;;;;AAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1C,IAAuB,EACvB,IAAuB;IAEvB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;QACjE,OAAO,KAAK,CAAC;KACd;;;UA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":["ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["import { ɵglobal } from '@angular/core';\n\nexport function isAngularInTestMode(): boolean {\n return (\n typeof ɵglobal.__karma__ !== 'undefined' ||\n typeof ɵglobal.jasmine !== 'undefined' ||\n typeof ɵglobal.jest !== 'undefined' ||\n typeof ɵglobal.Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;AAEA,SAAgB,mBAAmB;IACjC,QACE,OAAO,OAAO,CAAC,SAAS,KAAK,WAAW;QACxC,OAAO,OAAO,CAAC,OAAO,KAAK,WAAW;QACtC,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW;QACnC,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW,EACpC;CACH;;;;;;ACTD,MAIa,gBAAgB;IAD7B;;;;QAKU,eAAU,GAAG,IAAI,aAAa,CAAU,CAAC,CAAC,CAAC;KAcpD;;;;IAZC,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;KACvC;;;;;;IAMD,SAAS;QACP,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;KAC5B;;;YAlBF,UAAU;;;;;;;;IAKT,sCAAmD;;;;;;;;;;;;ACRrD,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;IAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;CAChB;;;;;;;AAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1C,IAAuB,EACvB,IAAuB;IAEvB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;QACjE,OAAO,KAAK,CAAC;KACd;;;UAGK,MAAM,GAAG,IAAI,CAAC,MA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IAEnB,mDAAkB;;IAElB,mDAAkB;;;;;;;AAIpB,8BAGC;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,73 @@
1
- import { getPlatform, COMPILER_OPTIONS, Injectable, InjectionToken, ɵɵdirectiveInject, INJECTOR, ɵglobal } from '@angular/core';
1
+ import { ɵglobal, Injectable, InjectionToken, ɵɵdirectiveInject, INJECTOR } from '@angular/core';
2
2
  import { ReplaySubject } from 'rxjs';
3
3
 
4
+ /**
5
+ * @fileoverview added by tsickle
6
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7
+ */
8
+ /**
9
+ * @return {?}
10
+ */
11
+ function isAngularInTestMode() {
12
+ return (typeof ɵglobal.__karma__ !== 'undefined' ||
13
+ typeof ɵglobal.jasmine !== 'undefined' ||
14
+ typeof ɵglobal.jest !== 'undefined' ||
15
+ typeof ɵglobal.Mocha !== 'undefined');
16
+ }
17
+
18
+ /**
19
+ * @fileoverview added by tsickle
20
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
21
+ */
22
+ var NgxsBootstrapper = /** @class */ (function () {
23
+ function NgxsBootstrapper() {
24
+ /**
25
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
26
+ */
27
+ this.bootstrap$ = new ReplaySubject(1);
28
+ }
29
+ Object.defineProperty(NgxsBootstrapper.prototype, "appBootstrapped$", {
30
+ get: /**
31
+ * @return {?}
32
+ */
33
+ function () {
34
+ return this.bootstrap$.asObservable();
35
+ },
36
+ enumerable: true,
37
+ configurable: true
38
+ });
39
+ /**
40
+ * This event will be emitted after attaching `ComponentRef` of the root component
41
+ * to the tree of views, that's a signal that application has been fully rendered
42
+ */
43
+ /**
44
+ * This event will be emitted after attaching `ComponentRef` of the root component
45
+ * to the tree of views, that's a signal that application has been fully rendered
46
+ * @return {?}
47
+ */
48
+ NgxsBootstrapper.prototype.bootstrap = /**
49
+ * This event will be emitted after attaching `ComponentRef` of the root component
50
+ * to the tree of views, that's a signal that application has been fully rendered
51
+ * @return {?}
52
+ */
53
+ function () {
54
+ this.bootstrap$.next(true);
55
+ this.bootstrap$.complete();
56
+ };
57
+ NgxsBootstrapper.decorators = [
58
+ { type: Injectable }
59
+ ];
60
+ return NgxsBootstrapper;
61
+ }());
62
+ if (false) {
63
+ /**
64
+ * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
65
+ * @type {?}
66
+ * @private
67
+ */
68
+ NgxsBootstrapper.prototype.bootstrap$;
69
+ }
70
+
4
71
  /**
5
72
  * @fileoverview added by tsickle
6
73
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -72,103 +139,6 @@ function memoize(func, equalityCheck) {
72
139
  return (/** @type {?} */ (memoized));
73
140
  }
74
141
 
75
- /**
76
- * @fileoverview added by tsickle
77
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
78
- */
79
- /**
80
- * @return {?}
81
- */
82
- function _isAngularInTestMode() {
83
- /** @type {?} */
84
- var platformRef = getPlatform();
85
- if (!platformRef)
86
- return false;
87
- /** @type {?} */
88
- var compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);
89
- if (!compilerOptions)
90
- return false;
91
- /** @type {?} */
92
- var isInTestMode = compilerOptions.some((/**
93
- * @param {?} item
94
- * @return {?}
95
- */
96
- function (item) {
97
- /** @type {?} */
98
- var providers = (item && item.providers) || [];
99
- return providers.some((/**
100
- * @param {?} provider
101
- * @return {?}
102
- */
103
- function (provider) {
104
- return ((provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||
105
- false);
106
- }));
107
- }));
108
- return isInTestMode;
109
- }
110
- /** @type {?} */
111
- var isAngularInTestMode =
112
- // Caretaker note: we have still left the `typeof` condition in order to avoid
113
- // creating a breaking change for projects that still use the View Engine.
114
- typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : (/**
115
- * @return {?}
116
- */
117
- function () { return false; });
118
-
119
- /**
120
- * @fileoverview added by tsickle
121
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
122
- */
123
- var NgxsBootstrapper = /** @class */ (function () {
124
- function NgxsBootstrapper() {
125
- /**
126
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
127
- */
128
- this.bootstrap$ = new ReplaySubject(1);
129
- }
130
- Object.defineProperty(NgxsBootstrapper.prototype, "appBootstrapped$", {
131
- get: /**
132
- * @return {?}
133
- */
134
- function () {
135
- return this.bootstrap$.asObservable();
136
- },
137
- enumerable: true,
138
- configurable: true
139
- });
140
- /**
141
- * This event will be emitted after attaching `ComponentRef` of the root component
142
- * to the tree of views, that's a signal that application has been fully rendered
143
- */
144
- /**
145
- * This event will be emitted after attaching `ComponentRef` of the root component
146
- * to the tree of views, that's a signal that application has been fully rendered
147
- * @return {?}
148
- */
149
- NgxsBootstrapper.prototype.bootstrap = /**
150
- * This event will be emitted after attaching `ComponentRef` of the root component
151
- * to the tree of views, that's a signal that application has been fully rendered
152
- * @return {?}
153
- */
154
- function () {
155
- this.bootstrap$.next(true);
156
- this.bootstrap$.complete();
157
- };
158
- NgxsBootstrapper.decorators = [
159
- { type: Injectable }
160
- ];
161
- return NgxsBootstrapper;
162
- }());
163
- if (false) {
164
- /**
165
- * Use `ReplaySubject`, thus we can get cached value even if the stream is completed
166
- * @type {?}
167
- * @private
168
- */
169
- NgxsBootstrapper.prototype.bootstrap$;
170
- }
171
-
172
142
  /**
173
143
  * @fileoverview added by tsickle
174
144
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -1 +1 @@
1
- {"version":3,"file":"ngxs-store-internals.js","sources":["ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { getPlatform, COMPILER_OPTIONS, CompilerOptions, PlatformRef } from '@angular/core';\nimport { memoize } from './memoize';\n\n/**\n * @description Will be provided through Terser global definitions by Angular CLI\n * during the production build. This is how Angular does tree-shaking internally.\n */\ndeclare const ngDevMode: boolean;\n\nfunction _isAngularInTestMode(): boolean {\n const platformRef: PlatformRef | null = getPlatform();\n if (!platformRef) return false;\n const compilerOptions = platformRef.injector.get(COMPILER_OPTIONS, null);\n if (!compilerOptions) return false;\n const isInTestMode = compilerOptions.some((item: CompilerOptions) => {\n const providers = (item && item.providers) || [];\n return providers.some((provider: any) => {\n return (\n (provider && provider.provide && provider.provide.name === 'MockNgModuleResolver') ||\n false\n );\n });\n });\n return isInTestMode;\n}\n\nexport const isAngularInTestMode =\n // Caretaker note: we have still left the `typeof` condition in order to avoid\n // creating a breaking change for projects that still use the View Engine.\n typeof ngDevMode === 'undefined' || ngDevMode ? memoize(_isAngularInTestMode) : () => false;\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAS,oBAAoB,CAAC,CAAM,EAAE,CAAM;IAC1C,OAAO,CAAC,KAAK,CAAC,CAAC;CAChB;;;;;;;AAED,SAAS,0BAA0B,CACjC,aAA0C,EAC1C,IAAuB,EACvB,IAAuB;IAEvB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;QACjE,OAAO,KAAK,CAAC;KACd;;;QAGK,MAAM,GAAG,IAAI,CAAC,MAAM;IAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;YACpC,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;CACb;;;;;;;;;;;AAQD,SAAgB,OAAO,CACrB,IAA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,QAAQ,CAAC,gBAAgB,CAAC,GAAG,iBAAiB;;;;QAI5C,QAAQ,CACT,CAAC;;;YAGI,iBAAiB,GAAG,QAAQ,CAAC,gBAAgB,CAAC;QACpD,IAAI,iBAAiB,EAAE;YACrB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7B,iBAAiB,CAAC,QAAQ,EAAE,CAAC;SAC9B;QAED,OAAO,QAAQ,CAAC;KACjB,CAAA;;;IAID,IAAI,GAAG,EAAE;QACP,GAAG,CAAC,OAAO,GAAG,gBAAgB,CAAC;KAChC;;;IAID,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,cAAc,EAAE;QACjD,GAAG;;;QAAE,cAAM,OAAA,gBAAgB,GAAA,CAAA;KAC5B,CAAC,CAAC;CACJ;;;;;AAED,SAAS,oBAAoB,CAAC,WAAgD;;;;;IAK5E,IAAI;QACF,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI;;;QAAC;YACrB,eAAe,CAAC,WAAW,CAAC,CAAC;SAC9B,EAAC,CAAC;KACJ;IAAC,WAAM;;;QAGN,OAAO,CAAC,OAAO;YACb,OAAO,CAAC,OAAO,CAAC,QAAQ;YACxB,OAAO,CAAC,OAAO,CAAC,QAAQ;;;YAAC;gBACvB,eAAe,CAAC,WAAW,CAAC,CAAC;aAC9B,EAAC,CAAC;KACN;CACF;;;;AAQD,yBAEC;;;IADC,6BAAwB;;;;;AAG1B,kDAUC;;;IARC,oDAAmB;;IAEnB,oDAAmB;;IAEnB,mDAAkB;;IAElB,mDAAkB;;;;;;;AAIpB,8BAGC;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ngxs-store-internals.js","sources":["ng://@ngxs/store/internals/angular.ts","ng://@ngxs/store/internals/ngxs-bootstrapper.ts","ng://@ngxs/store/internals/memoize.ts","ng://@ngxs/store/internals/initial-state.ts","ng://@ngxs/store/internals/internal-tokens.ts","ng://@ngxs/store/internals/decorator-injector-adapter.ts"],"sourcesContent":["import { ɵglobal } from '@angular/core';\n\nexport function isAngularInTestMode(): boolean {\n return (\n typeof ɵglobal.__karma__ !== 'undefined' ||\n typeof ɵglobal.jasmine !== 'undefined' ||\n typeof ɵglobal.jest !== 'undefined' ||\n typeof ɵglobal.Mocha !== 'undefined'\n );\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, ReplaySubject } from 'rxjs';\n\n@Injectable()\nexport class NgxsBootstrapper {\n /**\n * Use `ReplaySubject`, thus we can get cached value even if the stream is completed\n */\n private bootstrap$ = new ReplaySubject<boolean>(1);\n\n get appBootstrapped$(): Observable<boolean> {\n return this.bootstrap$.asObservable();\n }\n\n /**\n * This event will be emitted after attaching `ComponentRef` of the root component\n * to the tree of views, that's a signal that application has been fully rendered\n */\n bootstrap(): void {\n this.bootstrap$.next(true);\n this.bootstrap$.complete();\n }\n}\n","function defaultEqualityCheck(a: any, b: any) {\n return a === b;\n}\n\nfunction areArgumentsShallowlyEqual(\n equalityCheck: (a: any, b: any) => boolean,\n prev: IArguments | null,\n next: IArguments | null\n) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n\n // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n const length = prev.length;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Memoize a function on its last inputs only.\n * Originally from: https://github.com/reduxjs/reselect/blob/master/src/index.js\n *\n * @ignore\n */\nexport function memoize<T extends (...args: any[]) => any>(\n func: T,\n equalityCheck = defaultEqualityCheck\n): T {\n let lastArgs: IArguments | null = null;\n let lastResult: any = null;\n // we reference arguments instead of spreading them for performance reasons\n function memoized() {\n if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) {\n // apply arguments instead of spreading for performance.\n lastResult = (<Function>func).apply(null, arguments);\n }\n\n lastArgs = arguments;\n return lastResult;\n }\n (<any>memoized).reset = function() {\n // The hidden (for now) ability to reset the memoization\n lastArgs = null;\n lastResult = null;\n };\n return memoized as T;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PlainObject } from './symbols';\n\nexport const INITIAL_STATE_TOKEN = new InjectionToken<any>('INITIAL_STATE_TOKEN');\n\nexport class InitialState {\n private static value: PlainObject = {};\n\n public static set(state: PlainObject) {\n this.value = state;\n }\n\n public static pop(): PlainObject {\n const state: PlainObject = this.value;\n this.value = {};\n return state;\n }\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * @see StateContextFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_CONTEXT_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateContextFactory'\n);\n\n/**\n * @see StateFactory as it's referenced by this token to be accessed by plugins internally\n */\nexport const NGXS_STATE_FACTORY: InjectionToken<any> = new InjectionToken(\n 'Internals.StateFactory'\n);\n","import {\n InjectionToken,\n Injector,\n INJECTOR,\n Type,\n ɵɵdirectiveInject,\n ɵglobal\n} from '@angular/core';\nimport { ReplaySubject } from 'rxjs';\n\n// Will be provided through Terser global definitions by Angular CLI\n// during the production build. This is how Angular does tree-shaking internally.\ndeclare const ngDevMode: boolean;\n\n// Angular doesn't export `NG_FACTORY_DEF`.\nconst NG_FACTORY_DEF = 'ɵfac';\n\n// A `Symbol` which is used to save the `Injector` onto the class instance.\nconst InjectorInstance: unique symbol = Symbol('InjectorInstance');\n\n// A `Symbol` which is used to determine if factory has been decorated previously or not.\nconst FactoryHasBeenDecorated: unique symbol = Symbol('FactoryHasBeenDecorated');\n\n// A `Symbol` which is used to save the notifier on the class instance. The `InjectorInstance` cannot\n// be retrieved within the `constructor` since it's set after the `factory()` is called.\nconst InjectorNotifier: unique symbol = Symbol('InjectorNotifier');\n\ninterface PrototypeWithInjectorNotifier extends Object {\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n\nexport function ensureInjectorNotifierIsCaptured(\n target: PrototypeWithInjectorNotifier | PrivateInstance\n): ReplaySubject<boolean> {\n if (target[InjectorNotifier]) {\n return target[InjectorNotifier]!;\n } else {\n const injectorNotifier$ = new ReplaySubject<boolean>(1);\n Object.defineProperty(target, InjectorNotifier, {\n get: () => injectorNotifier$\n });\n return injectorNotifier$;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function ensureLocalInjectorCaptured(target: Object): void {\n if (FactoryHasBeenDecorated in target.constructor.prototype) {\n return;\n }\n\n const constructor: ConstructorWithDefinitionAndFactory = target.constructor;\n // Means we're in AOT mode.\n if (typeof constructor[NG_FACTORY_DEF] === 'function') {\n decorateFactory(constructor);\n } else if (ngDevMode) {\n // We're running in JIT mode and that means we're not able to get the compiled definition\n // on the class inside the property decorator during the current message loop tick. We have\n // to wait for the next message loop tick. Note that this is safe since this Promise will be\n // resolved even before the `APP_INITIALIZER` is resolved.\n // The below code also will be executed only in development mode, since it's never recommended\n // to use the JIT compiler in production mode (by setting \"aot: false\").\n decorateFactoryLater(constructor);\n }\n\n target.constructor.prototype[FactoryHasBeenDecorated] = true;\n}\n\nexport function localInject<T>(\n instance: PrivateInstance,\n token: InjectionToken<T> | Type<T>\n): T | null {\n const injector: Injector | undefined = instance[InjectorInstance];\n return injector ? injector.get(token) : null;\n}\n\nfunction decorateFactory(constructor: ConstructorWithDefinitionAndFactory): void {\n const factory = constructor[NG_FACTORY_DEF];\n\n if (typeof factory !== 'function') {\n return;\n }\n\n // Let's try to get any definition.\n // Caretaker note: this will be compatible only with Angular 9+, since Angular 9 is the first\n // Ivy-stable version. Previously definition properties were named differently (e.g. `ngComponentDef`).\n const def = constructor.ɵprov || constructor.ɵpipe || constructor.ɵcmp || constructor.ɵdir;\n\n const decoratedFactory = () => {\n const instance = factory();\n // Caretaker note: `inject()` won't work here.\n // We can use the `directiveInject` only during the component\n // construction, since Angular captures the currently active injector.\n // We're not able to use this function inside the getter (when the `selectorId` property is\n // requested for the first time), since the currently active injector will be null.\n instance[InjectorInstance] = ɵɵdirectiveInject(\n // We're using `INJECTOR` token except of the `Injector` class since the compiler\n // throws: `Cannot assign an abstract constructor type to a non-abstract constructor type.`.\n // Caretaker note: that this is the same way of getting the injector.\n INJECTOR\n );\n\n // Caretaker note: the notifier will be available only if consumers call the `ensureInjectorNotifierIsCaptured()`.\n const injectorNotifier$ = instance[InjectorNotifier];\n if (injectorNotifier$) {\n injectorNotifier$.next(true);\n injectorNotifier$.complete();\n }\n\n return instance;\n };\n\n // If we've found any definition then it's enough to override the `def.factory` since Angular\n // code uses the `def.factory` and then fallbacks to `ɵfac`.\n if (def) {\n def.factory = decoratedFactory;\n }\n\n // `@NgModule()` doesn't doesn't have definition factory, also providers have definitions but Angular\n // still uses the `ɵfac`.\n Object.defineProperty(constructor, NG_FACTORY_DEF, {\n get: () => decoratedFactory\n });\n}\n\nfunction decorateFactoryLater(constructor: ConstructorWithDefinitionAndFactory): void {\n // This function actually will be tree-shaken away when building for production since it's guarded with `ngDevMode`.\n // We're having the `try-catch` here because of the `SyncTestZoneSpec`, which throws\n // an error when micro or macrotask is used within a synchronous test. E.g. `Cannot call\n // Promise.then from within a sync test`.\n try {\n Promise.resolve().then(() => {\n decorateFactory(constructor);\n });\n } catch {\n // This is kind of a \"hack\", but we try to be backwards-compatible,\n // tho this `catch` block will only be executed when tests are run with Jasmine or Jest.\n ɵglobal.process &&\n ɵglobal.process.nextTick &&\n ɵglobal.process.nextTick(() => {\n decorateFactory(constructor);\n });\n }\n}\n\n// We could've used `ɵɵFactoryDef` but we try to be backwards-compatible,\n// since it's not exported in older Angular versions.\ntype Factory = () => PrivateInstance;\n\n// We could've used `ɵɵInjectableDef`, `ɵɵPipeDef`, etc. We try to be backwards-compatible\n// since they're not exported in older Angular versions.\ninterface Definition {\n factory: Factory | null;\n}\n\ninterface ConstructorWithDefinitionAndFactory extends Function {\n // Provider definition for the `@Injectable()` class.\n ɵprov?: Definition;\n // Pipe definition for the `@Pipe()` class.\n ɵpipe?: Definition;\n // Component definition for the `@Component()` class.\n ɵcmp?: Definition;\n // Directive definition for the `@Directive()` class.\n ɵdir?: Definition;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;;;;"}
@@ -1,3 +1 @@
1
- declare function _isAngularInTestMode(): boolean;
2
- export declare const isAngularInTestMode: typeof _isAngularInTestMode;
3
- export {};
1
+ export declare function isAngularInTestMode(): boolean;
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"isAngularInTestMode":{"__symbolic":"if","condition":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":29,"character":2,"module":"./angular"},"right":"undefined"},"right":{"__symbolic":"error","message":"Reference to a local symbol","line":7,"character":14,"context":{"name":"ngDevMode"},"module":"./angular"}},"thenExpression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"memoize"},"arguments":[{"__symbolic":"error","message":"Reference to a non-exported function","line":9,"character":9,"context":{"name":"_isAngularInTestMode"},"module":"./angular"}]},"elseExpression":{"__symbolic":"error","message":"Lambda not supported","line":29,"character":82,"module":"./angular"}},"NgxsBootstrapper":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":3,"character":1}}],"members":{"bootstrap":[{"__symbolic":"method"}]}},"memoize":{"__symbolic":"function"},"INITIAL_STATE_TOKEN":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":39},"arguments":["INITIAL_STATE_TOKEN"]},"InitialState":{"__symbolic":"class","members":{},"statics":{"value":{}}},"PlainObjectOf":{"__symbolic":"interface"},"PlainObject":{"__symbolic":"interface"},"StateClass":{"__symbolic":"interface"},"NGXS_STATE_CONTEXT_FACTORY":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":67},"arguments":["Internals.StateContextFactory"]},"NGXS_STATE_FACTORY":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":12,"character":59},"arguments":["Internals.StateFactory"]},"localInject":{"__symbolic":"function"},"ensureLocalInjectorCaptured":{"__symbolic":"function"},"ensureInjectorNotifierIsCaptured":{"__symbolic":"function"}},"origins":{"isAngularInTestMode":"./angular","NgxsBootstrapper":"./ngxs-bootstrapper","memoize":"./memoize","INITIAL_STATE_TOKEN":"./initial-state","InitialState":"./initial-state","PlainObjectOf":"./symbols","PlainObject":"./symbols","StateClass":"./symbols","NGXS_STATE_CONTEXT_FACTORY":"./internal-tokens","NGXS_STATE_FACTORY":"./internal-tokens","localInject":"./decorator-injector-adapter","ensureLocalInjectorCaptured":"./decorator-injector-adapter","ensureInjectorNotifierIsCaptured":"./decorator-injector-adapter"},"importAs":"@ngxs/store/internals"}
1
+ {"__symbolic":"module","version":4,"metadata":{"isAngularInTestMode":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"error","message":"Expression form not supported","line":4,"character":4,"module":"./angular"},"right":"undefined"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"error","message":"Expression form not supported","line":5,"character":4,"module":"./angular"},"right":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"error","message":"Expression form not supported","line":6,"character":4,"module":"./angular"},"right":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"error","message":"Expression form not supported","line":7,"character":4,"module":"./angular"},"right":"undefined"}}},"NgxsBootstrapper":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":3,"character":1}}],"members":{"bootstrap":[{"__symbolic":"method"}]}},"memoize":{"__symbolic":"function"},"INITIAL_STATE_TOKEN":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":39},"arguments":["INITIAL_STATE_TOKEN"]},"InitialState":{"__symbolic":"class","members":{},"statics":{"value":{}}},"PlainObjectOf":{"__symbolic":"interface"},"PlainObject":{"__symbolic":"interface"},"StateClass":{"__symbolic":"interface"},"NGXS_STATE_CONTEXT_FACTORY":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":67},"arguments":["Internals.StateContextFactory"]},"NGXS_STATE_FACTORY":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":12,"character":59},"arguments":["Internals.StateFactory"]},"localInject":{"__symbolic":"function"},"ensureLocalInjectorCaptured":{"__symbolic":"function"},"ensureInjectorNotifierIsCaptured":{"__symbolic":"function"}},"origins":{"isAngularInTestMode":"./angular","NgxsBootstrapper":"./ngxs-bootstrapper","memoize":"./memoize","INITIAL_STATE_TOKEN":"./initial-state","InitialState":"./initial-state","PlainObjectOf":"./symbols","PlainObject":"./symbols","StateClass":"./symbols","NGXS_STATE_CONTEXT_FACTORY":"./internal-tokens","NGXS_STATE_FACTORY":"./internal-tokens","localInject":"./decorator-injector-adapter","ensureLocalInjectorCaptured":"./decorator-injector-adapter","ensureInjectorNotifierIsCaptured":"./decorator-injector-adapter"},"importAs":"@ngxs/store/internals"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "../../node_modules/ng-packagr/package.schema.json",
3
3
  "name": "@ngxs/store",
4
- "version": "3.7.3-dev.master-cdd7ae3",
4
+ "version": "3.7.3-dev.master-69553aa",
5
5
  "license": "MIT",
6
6
  "sideEffects": true,
7
7
  "peerDependencies": {