@ngxs/store 3.7.3-dev.master-d470dff → 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.
- package/bundles/ngxs-store-internals.umd.js +67 -97
- package/bundles/ngxs-store-internals.umd.js.map +1 -1
- package/bundles/ngxs-store-internals.umd.min.js +1 -1
- package/bundles/ngxs-store-internals.umd.min.js.map +1 -1
- package/bundles/ngxs-store.umd.js +94 -59
- package/bundles/ngxs-store.umd.js.map +1 -1
- package/bundles/ngxs-store.umd.min.js +1 -1
- package/bundles/ngxs-store.umd.min.js.map +1 -1
- package/esm2015/internals/angular.js +7 -38
- package/esm2015/ngxs-store.js +12 -13
- package/esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +4 -2
- package/esm2015/src/execution/noop-ngxs-execution-strategy.js +4 -2
- package/esm2015/src/execution/symbols.js +26 -3
- package/esm2015/src/internal/state-stream.js +10 -1
- package/esm2015/src/module.js +4 -5
- package/esm5/internals/angular.js +7 -38
- package/esm5/ngxs-store.js +12 -13
- package/esm5/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +4 -2
- package/esm5/src/execution/noop-ngxs-execution-strategy.js +4 -2
- package/esm5/src/execution/symbols.js +26 -3
- package/esm5/src/internal/state-stream.js +13 -1
- package/esm5/src/module.js +4 -5
- package/fesm2015/ngxs-store-internals.js +54 -84
- package/fesm2015/ngxs-store-internals.js.map +1 -1
- package/fesm2015/ngxs-store.js +64 -32
- package/fesm2015/ngxs-store.js.map +1 -1
- package/fesm5/ngxs-store-internals.js +68 -98
- package/fesm5/ngxs-store-internals.js.map +1 -1
- package/fesm5/ngxs-store.js +80 -45
- package/fesm5/ngxs-store.js.map +1 -1
- package/internals/angular.d.ts +1 -3
- package/internals/ngxs-store-internals.metadata.json +1 -1
- package/ngxs-store.d.ts +11 -12
- package/ngxs-store.metadata.json +1 -1
- package/package.json +1 -1
- package/src/execution/symbols.d.ts +5 -1
- package/src/internal/state-stream.d.ts +3 -1
|
@@ -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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;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngxs-store-internals.umd.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;\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,IAAu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;QAAC,WAAM;;;YAGNL,YAAO,CAAC,OAAO;gBACbA,YAAO,CAAC,OAAO,CAAC,QAAQ;gBACxBA,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";
|
|
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,EAAeC,EAAUQ,aAEvDP,EAAa,EAAiBQ,MAAM,KAAMD,YAG5CR,EAAWQ,UACJP,EAOT,OALA,EAAgBS,MAAK,WAEnBV,EAAW,KACXC,EAAa,MAEf,ECzBF,IAAaU,EAGU,oBAAdC,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1D,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,GACpC,OAAOD,IAAMC,ECEf,IAAaC,EAAsB,IAAIC,EAAAA,eAAoB,uBAE3DC,EAAA,WAAA,SAAAA,KAYA,OATgBA,EAAAC,IAAd,SAAkBC,GAChBlB,KAAKmB,MAAQD,G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,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"]}
|
|
@@ -382,13 +382,14 @@
|
|
|
382
382
|
return func();
|
|
383
383
|
};
|
|
384
384
|
DispatchOutsideZoneNgxsExecutionStrategy.decorators = [
|
|
385
|
-
{ type: core.Injectable }
|
|
385
|
+
{ type: core.Injectable, args: [{ providedIn: 'root' },] }
|
|
386
386
|
];
|
|
387
387
|
/** @nocollapse */
|
|
388
388
|
DispatchOutsideZoneNgxsExecutionStrategy.ctorParameters = function () { return [
|
|
389
389
|
{ type: core.NgZone },
|
|
390
390
|
{ type: String, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] }
|
|
391
391
|
]; };
|
|
392
|
+
/** @nocollapse */ DispatchOutsideZoneNgxsExecutionStrategy.ngInjectableDef = core.defineInjectable({ factory: function DispatchOutsideZoneNgxsExecutionStrategy_Factory() { return new DispatchOutsideZoneNgxsExecutionStrategy(core.inject(core.NgZone), core.inject(core.PLATFORM_ID)); }, token: DispatchOutsideZoneNgxsExecutionStrategy, providedIn: "root" });
|
|
392
393
|
return DispatchOutsideZoneNgxsExecutionStrategy;
|
|
393
394
|
}());
|
|
394
395
|
if (false) {
|
|
@@ -643,11 +644,72 @@
|
|
|
643
644
|
* @fileoverview added by tsickle
|
|
644
645
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
645
646
|
*/
|
|
647
|
+
var NoopNgxsExecutionStrategy = /** @class */ (function () {
|
|
648
|
+
function NoopNgxsExecutionStrategy() {
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* @template T
|
|
652
|
+
* @param {?} func
|
|
653
|
+
* @return {?}
|
|
654
|
+
*/
|
|
655
|
+
NoopNgxsExecutionStrategy.prototype.enter = /**
|
|
656
|
+
* @template T
|
|
657
|
+
* @param {?} func
|
|
658
|
+
* @return {?}
|
|
659
|
+
*/
|
|
660
|
+
function (func) {
|
|
661
|
+
return func();
|
|
662
|
+
};
|
|
663
|
+
/**
|
|
664
|
+
* @template T
|
|
665
|
+
* @param {?} func
|
|
666
|
+
* @return {?}
|
|
667
|
+
*/
|
|
668
|
+
NoopNgxsExecutionStrategy.prototype.leave = /**
|
|
669
|
+
* @template T
|
|
670
|
+
* @param {?} func
|
|
671
|
+
* @return {?}
|
|
672
|
+
*/
|
|
673
|
+
function (func) {
|
|
674
|
+
return func();
|
|
675
|
+
};
|
|
676
|
+
NoopNgxsExecutionStrategy.decorators = [
|
|
677
|
+
{ type: core.Injectable, args: [{ providedIn: 'root' },] }
|
|
678
|
+
];
|
|
679
|
+
/** @nocollapse */ NoopNgxsExecutionStrategy.ngInjectableDef = core.defineInjectable({ factory: function NoopNgxsExecutionStrategy_Factory() { return new NoopNgxsExecutionStrategy(); }, token: NoopNgxsExecutionStrategy, providedIn: "root" });
|
|
680
|
+
return NoopNgxsExecutionStrategy;
|
|
681
|
+
}());
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* @fileoverview added by tsickle
|
|
685
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
686
|
+
*/
|
|
687
|
+
/**
|
|
688
|
+
* The strategy that might be provided by users through `options.executionStrategy`.
|
|
689
|
+
* @type {?}
|
|
690
|
+
*/
|
|
691
|
+
var USER_PROVIDED_NGXS_EXECUTION_STRATEGY = new core.InjectionToken('USER_PROVIDED_NGXS_EXECUTION_STRATEGY');
|
|
646
692
|
/*
|
|
647
693
|
* Internal execution strategy injection token
|
|
648
694
|
*/
|
|
649
695
|
/** @type {?} */
|
|
650
|
-
var NGXS_EXECUTION_STRATEGY = new core.InjectionToken('NGXS_EXECUTION_STRATEGY'
|
|
696
|
+
var NGXS_EXECUTION_STRATEGY = new core.InjectionToken('NGXS_EXECUTION_STRATEGY', {
|
|
697
|
+
providedIn: 'root',
|
|
698
|
+
factory: (/**
|
|
699
|
+
* @return {?}
|
|
700
|
+
*/
|
|
701
|
+
function () {
|
|
702
|
+
/** @type {?} */
|
|
703
|
+
var injector = core.inject(core.INJECTOR);
|
|
704
|
+
/** @type {?} */
|
|
705
|
+
var executionStrategy = injector.get(USER_PROVIDED_NGXS_EXECUTION_STRATEGY);
|
|
706
|
+
return executionStrategy
|
|
707
|
+
? injector.get(executionStrategy)
|
|
708
|
+
: injector.get(typeof core.ɵglobal.Zone !== 'undefined'
|
|
709
|
+
? DispatchOutsideZoneNgxsExecutionStrategy
|
|
710
|
+
: NoopNgxsExecutionStrategy);
|
|
711
|
+
})
|
|
712
|
+
});
|
|
651
713
|
/**
|
|
652
714
|
* @record
|
|
653
715
|
*/
|
|
@@ -1859,6 +1921,18 @@
|
|
|
1859
1921
|
function StateStream() {
|
|
1860
1922
|
return _super.call(this, {}) || this;
|
|
1861
1923
|
}
|
|
1924
|
+
/**
|
|
1925
|
+
* @return {?}
|
|
1926
|
+
*/
|
|
1927
|
+
StateStream.prototype.ngOnDestroy = /**
|
|
1928
|
+
* @return {?}
|
|
1929
|
+
*/
|
|
1930
|
+
function () {
|
|
1931
|
+
// The `StateStream` should never emit values once the root view is removed, e.g. when the `NgModuleRef.destroy()` is called.
|
|
1932
|
+
// This will eliminate memory leaks in server-side rendered apps where the `StateStream` is created per each HTTP request, users
|
|
1933
|
+
// might forget to unsubscribe from `store.select` or `store.subscribe`, thus this will lead to huge memory leaks in SSR apps.
|
|
1934
|
+
this.complete();
|
|
1935
|
+
};
|
|
1862
1936
|
StateStream.decorators = [
|
|
1863
1937
|
{ type: core.Injectable }
|
|
1864
1938
|
];
|
|
@@ -4053,8 +4127,8 @@
|
|
|
4053
4127
|
function (states, options) {
|
|
4054
4128
|
return [
|
|
4055
4129
|
{
|
|
4056
|
-
provide:
|
|
4057
|
-
|
|
4130
|
+
provide: USER_PROVIDED_NGXS_EXECUTION_STRATEGY,
|
|
4131
|
+
useValue: options.executionStrategy
|
|
4058
4132
|
},
|
|
4059
4133
|
{
|
|
4060
4134
|
provide: ROOT_STATE_TOKEN,
|
|
@@ -4629,45 +4703,6 @@
|
|
|
4629
4703
|
});
|
|
4630
4704
|
}
|
|
4631
4705
|
|
|
4632
|
-
/**
|
|
4633
|
-
* @fileoverview added by tsickle
|
|
4634
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4635
|
-
*/
|
|
4636
|
-
var NoopNgxsExecutionStrategy = /** @class */ (function () {
|
|
4637
|
-
function NoopNgxsExecutionStrategy() {
|
|
4638
|
-
}
|
|
4639
|
-
/**
|
|
4640
|
-
* @template T
|
|
4641
|
-
* @param {?} func
|
|
4642
|
-
* @return {?}
|
|
4643
|
-
*/
|
|
4644
|
-
NoopNgxsExecutionStrategy.prototype.enter = /**
|
|
4645
|
-
* @template T
|
|
4646
|
-
* @param {?} func
|
|
4647
|
-
* @return {?}
|
|
4648
|
-
*/
|
|
4649
|
-
function (func) {
|
|
4650
|
-
return func();
|
|
4651
|
-
};
|
|
4652
|
-
/**
|
|
4653
|
-
* @template T
|
|
4654
|
-
* @param {?} func
|
|
4655
|
-
* @return {?}
|
|
4656
|
-
*/
|
|
4657
|
-
NoopNgxsExecutionStrategy.prototype.leave = /**
|
|
4658
|
-
* @template T
|
|
4659
|
-
* @param {?} func
|
|
4660
|
-
* @return {?}
|
|
4661
|
-
*/
|
|
4662
|
-
function (func) {
|
|
4663
|
-
return func();
|
|
4664
|
-
};
|
|
4665
|
-
NoopNgxsExecutionStrategy.decorators = [
|
|
4666
|
-
{ type: core.Injectable }
|
|
4667
|
-
];
|
|
4668
|
-
return NoopNgxsExecutionStrategy;
|
|
4669
|
-
}());
|
|
4670
|
-
|
|
4671
4706
|
/**
|
|
4672
4707
|
* @fileoverview added by tsickle
|
|
4673
4708
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -4757,22 +4792,22 @@
|
|
|
4757
4792
|
exports.ɵe = SELECTOR_META_KEY;
|
|
4758
4793
|
exports.ɵf = NgxsConfig;
|
|
4759
4794
|
exports.ɵg = mergeDeep;
|
|
4760
|
-
exports.ɵh =
|
|
4761
|
-
exports.ɵi =
|
|
4762
|
-
exports.ɵj =
|
|
4763
|
-
exports.ɵk =
|
|
4764
|
-
exports.ɵl =
|
|
4765
|
-
exports.ɵm =
|
|
4766
|
-
exports.ɵn =
|
|
4767
|
-
exports.ɵo =
|
|
4768
|
-
exports.ɵp =
|
|
4769
|
-
exports.ɵ
|
|
4770
|
-
exports.ɵs =
|
|
4771
|
-
exports.ɵt =
|
|
4772
|
-
exports.ɵu =
|
|
4773
|
-
exports.ɵv =
|
|
4774
|
-
exports.ɵw =
|
|
4775
|
-
exports.ɵx =
|
|
4795
|
+
exports.ɵh = USER_PROVIDED_NGXS_EXECUTION_STRATEGY;
|
|
4796
|
+
exports.ɵi = NGXS_EXECUTION_STRATEGY;
|
|
4797
|
+
exports.ɵj = NgxsRootModule;
|
|
4798
|
+
exports.ɵk = StateFactory;
|
|
4799
|
+
exports.ɵl = InternalDispatchedActionResults;
|
|
4800
|
+
exports.ɵm = InternalDispatcher;
|
|
4801
|
+
exports.ɵn = StateContextFactory;
|
|
4802
|
+
exports.ɵo = InternalStateOperations;
|
|
4803
|
+
exports.ɵp = PluginManager;
|
|
4804
|
+
exports.ɵq = InternalNgxsExecutionStrategy;
|
|
4805
|
+
exports.ɵs = ensureStoreMetadata;
|
|
4806
|
+
exports.ɵt = getStoreMetadata;
|
|
4807
|
+
exports.ɵu = ensureSelectorMetadata;
|
|
4808
|
+
exports.ɵv = getSelectorMetadata;
|
|
4809
|
+
exports.ɵw = LifecycleStateManager;
|
|
4810
|
+
exports.ɵx = NgxsFeatureModule;
|
|
4776
4811
|
|
|
4777
4812
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4778
4813
|
|