@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
package/esm5/src/module.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as tslib_1 from "tslib";
|
|
|
6
6
|
import { APP_BOOTSTRAP_LISTENER, InjectionToken, NgModule } from '@angular/core';
|
|
7
7
|
import { INITIAL_STATE_TOKEN, InitialState, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, NgxsBootstrapper } from '@ngxs/store/internals';
|
|
8
8
|
import { FEATURE_STATE_TOKEN, NgxsConfig, ROOT_STATE_TOKEN } from './symbols';
|
|
9
|
-
import {
|
|
9
|
+
import { USER_PROVIDED_NGXS_EXECUTION_STRATEGY } from './execution/symbols';
|
|
10
10
|
import { StateFactory } from './internal/state-factory';
|
|
11
11
|
import { StateContextFactory } from './internal/state-context-factory';
|
|
12
12
|
import { Actions, InternalActions } from './actions-stream';
|
|
@@ -18,7 +18,6 @@ import { StateStream } from './internal/state-stream';
|
|
|
18
18
|
import { PluginManager } from './plugin-manager';
|
|
19
19
|
import { NgxsRootModule } from './modules/ngxs-root.module';
|
|
20
20
|
import { NgxsFeatureModule } from './modules/ngxs-feature.module';
|
|
21
|
-
import { DispatchOutsideZoneNgxsExecutionStrategy } from './execution/dispatch-outside-zone-ngxs-execution-strategy';
|
|
22
21
|
import { InternalNgxsExecutionStrategy } from './execution/internal-ngxs-execution-strategy';
|
|
23
22
|
import { mergeDeep } from './utils/utils';
|
|
24
23
|
/**
|
|
@@ -108,8 +107,8 @@ var NgxsModule = /** @class */ (function () {
|
|
|
108
107
|
function (states, options) {
|
|
109
108
|
return [
|
|
110
109
|
{
|
|
111
|
-
provide:
|
|
112
|
-
|
|
110
|
+
provide: USER_PROVIDED_NGXS_EXECUTION_STRATEGY,
|
|
111
|
+
useValue: options.executionStrategy
|
|
113
112
|
},
|
|
114
113
|
{
|
|
115
114
|
provide: ROOT_STATE_TOKEN,
|
|
@@ -198,4 +197,4 @@ if (false) {
|
|
|
198
197
|
*/
|
|
199
198
|
NgxsModule.ROOT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TlRFWFRfRkFDVE9SWSxcbiAgICAgICAgdXNlRXhpc3Rpbmc6IFN0YXRlQ29udGV4dEZhY3RvcnlcbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIHByb3ZpZGU6IE5HWFNfU1RBVEVfRkFDVE9SWSxcbiAgICAgICAgdXNlRXhpc3Rpbmc6IFN0YXRlRmFjdG9yeVxuICAgICAgfVxuICAgIF07XG4gIH1cblxuICBwcml2YXRlIHN0YXRpYyBuZ3hzQ29uZmlnRmFjdG9yeShvcHRpb25zOiBOZ3hzTW9kdWxlT3B0aW9ucyk6IE5neHNDb25maWcge1xuICAgIHJldHVybiBtZXJnZURlZXAobmV3IE5neHNDb25maWcoKSwgb3B0aW9ucyk7XG4gIH1cblxuICBwcml2YXRlIHN0YXRpYyBhcHBCb290c3RyYXBMaXN0ZW5lckZhY3RvcnkoYm9vdHN0cmFwcGVyOiBOZ3hzQm9vdHN0cmFwcGVyKTogRnVuY3Rpb24ge1xuICAgIHJldHVybiAoKSA9PiBib290c3RyYXBwZXIuYm9vdHN0cmFwKCk7XG4gIH1cblxuICBwcml2YXRlIHN0YXRpYyBnZXRJbml0aWFsU3RhdGUoKSB7XG4gICAgcmV0dXJuIEluaXRpYWxTdGF0ZS5wb3AoKTtcbiAgfVxufVxuIl19
|
|
@@ -1,6 +1,59 @@
|
|
|
1
|
-
import {
|
|
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;;;UAGK,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,C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BAAgB,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,MAAM,gBAAgB,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;\n [NG_FACTORY_DEF]?: Factory;\n}\n\ninterface PrivateInstance {\n [InjectorInstance]?: Injector;\n [InjectorNotifier]?: ReplaySubject<boolean>;\n}\n"],"names":[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;;;;QAM1B,QAAQ,CAAC,gBAAgB,CAAC,GAAG,iBAAiB;;;;QAI5C,QAAQ,CACT,CAAC;;;cAGI,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,MAAM,gBAAgB,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;;;;;;;;;;;;;;;;;;;;"}
|
package/fesm2015/ngxs-store.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NgZone, Injectable, Inject, PLATFORM_ID, InjectionToken, Optional, SkipSelf, ErrorHandler, Injector,
|
|
1
|
+
import { NgZone, Injectable, Inject, PLATFORM_ID, defineInjectable, inject, InjectionToken, INJECTOR, ɵglobal, Optional, SkipSelf, ErrorHandler, Injector, ɵivyEnabled, NgModule, APP_BOOTSTRAP_LISTENER } from '@angular/core';
|
|
2
2
|
import { isAngularInTestMode, memoize, INITIAL_STATE_TOKEN, NgxsBootstrapper, NGXS_STATE_CONTEXT_FACTORY, NGXS_STATE_FACTORY, InitialState, ensureInjectorNotifierIsCaptured, localInject, ensureLocalInjectorCaptured } from '@ngxs/store/internals';
|
|
3
3
|
import { isPlatformServer } from '@angular/common';
|
|
4
4
|
import { Observable, Subject, BehaviorSubject, of, forkJoin, throwError, EMPTY, from } from 'rxjs';
|
|
@@ -146,13 +146,14 @@ class DispatchOutsideZoneNgxsExecutionStrategy {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
DispatchOutsideZoneNgxsExecutionStrategy.decorators = [
|
|
149
|
-
{ type: Injectable }
|
|
149
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
150
150
|
];
|
|
151
151
|
/** @nocollapse */
|
|
152
152
|
DispatchOutsideZoneNgxsExecutionStrategy.ctorParameters = () => [
|
|
153
153
|
{ type: NgZone },
|
|
154
154
|
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
|
|
155
155
|
];
|
|
156
|
+
/** @nocollapse */ DispatchOutsideZoneNgxsExecutionStrategy.ngInjectableDef = defineInjectable({ factory: function DispatchOutsideZoneNgxsExecutionStrategy_Factory() { return new DispatchOutsideZoneNgxsExecutionStrategy(inject(NgZone), inject(PLATFORM_ID)); }, token: DispatchOutsideZoneNgxsExecutionStrategy, providedIn: "root" });
|
|
156
157
|
if (false) {
|
|
157
158
|
/**
|
|
158
159
|
* @type {?}
|
|
@@ -403,11 +404,59 @@ if (false) {
|
|
|
403
404
|
* @fileoverview added by tsickle
|
|
404
405
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
405
406
|
*/
|
|
407
|
+
class NoopNgxsExecutionStrategy {
|
|
408
|
+
/**
|
|
409
|
+
* @template T
|
|
410
|
+
* @param {?} func
|
|
411
|
+
* @return {?}
|
|
412
|
+
*/
|
|
413
|
+
enter(func) {
|
|
414
|
+
return func();
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* @template T
|
|
418
|
+
* @param {?} func
|
|
419
|
+
* @return {?}
|
|
420
|
+
*/
|
|
421
|
+
leave(func) {
|
|
422
|
+
return func();
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
NoopNgxsExecutionStrategy.decorators = [
|
|
426
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
427
|
+
];
|
|
428
|
+
/** @nocollapse */ NoopNgxsExecutionStrategy.ngInjectableDef = defineInjectable({ factory: function NoopNgxsExecutionStrategy_Factory() { return new NoopNgxsExecutionStrategy(); }, token: NoopNgxsExecutionStrategy, providedIn: "root" });
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* @fileoverview added by tsickle
|
|
432
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
433
|
+
*/
|
|
434
|
+
/**
|
|
435
|
+
* The strategy that might be provided by users through `options.executionStrategy`.
|
|
436
|
+
* @type {?}
|
|
437
|
+
*/
|
|
438
|
+
const USER_PROVIDED_NGXS_EXECUTION_STRATEGY = new InjectionToken('USER_PROVIDED_NGXS_EXECUTION_STRATEGY');
|
|
406
439
|
/*
|
|
407
440
|
* Internal execution strategy injection token
|
|
408
441
|
*/
|
|
409
442
|
/** @type {?} */
|
|
410
|
-
const NGXS_EXECUTION_STRATEGY = new InjectionToken('NGXS_EXECUTION_STRATEGY'
|
|
443
|
+
const NGXS_EXECUTION_STRATEGY = new InjectionToken('NGXS_EXECUTION_STRATEGY', {
|
|
444
|
+
providedIn: 'root',
|
|
445
|
+
factory: (/**
|
|
446
|
+
* @return {?}
|
|
447
|
+
*/
|
|
448
|
+
() => {
|
|
449
|
+
/** @type {?} */
|
|
450
|
+
const injector = inject(INJECTOR);
|
|
451
|
+
/** @type {?} */
|
|
452
|
+
const executionStrategy = injector.get(USER_PROVIDED_NGXS_EXECUTION_STRATEGY);
|
|
453
|
+
return executionStrategy
|
|
454
|
+
? injector.get(executionStrategy)
|
|
455
|
+
: injector.get(typeof ɵglobal.Zone !== 'undefined'
|
|
456
|
+
? DispatchOutsideZoneNgxsExecutionStrategy
|
|
457
|
+
: NoopNgxsExecutionStrategy);
|
|
458
|
+
})
|
|
459
|
+
});
|
|
411
460
|
/**
|
|
412
461
|
* @record
|
|
413
462
|
*/
|
|
@@ -1539,6 +1588,15 @@ class StateStream extends BehaviorSubject {
|
|
|
1539
1588
|
constructor() {
|
|
1540
1589
|
super({});
|
|
1541
1590
|
}
|
|
1591
|
+
/**
|
|
1592
|
+
* @return {?}
|
|
1593
|
+
*/
|
|
1594
|
+
ngOnDestroy() {
|
|
1595
|
+
// The `StateStream` should never emit values once the root view is removed, e.g. when the `NgModuleRef.destroy()` is called.
|
|
1596
|
+
// This will eliminate memory leaks in server-side rendered apps where the `StateStream` is created per each HTTP request, users
|
|
1597
|
+
// might forget to unsubscribe from `store.select` or `store.subscribe`, thus this will lead to huge memory leaks in SSR apps.
|
|
1598
|
+
this.complete();
|
|
1599
|
+
}
|
|
1542
1600
|
}
|
|
1543
1601
|
StateStream.decorators = [
|
|
1544
1602
|
{ type: Injectable }
|
|
@@ -3394,8 +3452,8 @@ class NgxsModule {
|
|
|
3394
3452
|
static ngxsTokenProviders(states, options) {
|
|
3395
3453
|
return [
|
|
3396
3454
|
{
|
|
3397
|
-
provide:
|
|
3398
|
-
|
|
3455
|
+
provide: USER_PROVIDED_NGXS_EXECUTION_STRATEGY,
|
|
3456
|
+
useValue: options.executionStrategy
|
|
3399
3457
|
},
|
|
3400
3458
|
{
|
|
3401
3459
|
provide: ROOT_STATE_TOKEN,
|
|
@@ -3938,32 +3996,6 @@ function Selector(selectors) {
|
|
|
3938
3996
|
});
|
|
3939
3997
|
}
|
|
3940
3998
|
|
|
3941
|
-
/**
|
|
3942
|
-
* @fileoverview added by tsickle
|
|
3943
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3944
|
-
*/
|
|
3945
|
-
class NoopNgxsExecutionStrategy {
|
|
3946
|
-
/**
|
|
3947
|
-
* @template T
|
|
3948
|
-
* @param {?} func
|
|
3949
|
-
* @return {?}
|
|
3950
|
-
*/
|
|
3951
|
-
enter(func) {
|
|
3952
|
-
return func();
|
|
3953
|
-
}
|
|
3954
|
-
/**
|
|
3955
|
-
* @template T
|
|
3956
|
-
* @param {?} func
|
|
3957
|
-
* @return {?}
|
|
3958
|
-
*/
|
|
3959
|
-
leave(func) {
|
|
3960
|
-
return func();
|
|
3961
|
-
}
|
|
3962
|
-
}
|
|
3963
|
-
NoopNgxsExecutionStrategy.decorators = [
|
|
3964
|
-
{ type: Injectable }
|
|
3965
|
-
];
|
|
3966
|
-
|
|
3967
3999
|
/**
|
|
3968
4000
|
* @fileoverview added by tsickle
|
|
3969
4001
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -4028,5 +4060,5 @@ if (false) {
|
|
|
4028
4060
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4029
4061
|
*/
|
|
4030
4062
|
|
|
4031
|
-
export { Action, Actions, InitState, NGXS_PLUGINS, NgxsModule, NgxsSimpleChange, NoopNgxsExecutionStrategy, Select, Selector, SelectorOptions, State, StateStream, StateToken, Store, UpdateState, actionMatcher, createSelector, ensureSelectorMetadata$1 as ensureSelectorMetadata, ensureStoreMetadata$1 as ensureStoreMetadata, getActionTypeFromInstance, getSelectorMetadata$1 as getSelectorMetadata, getStoreMetadata$1 as getStoreMetadata, getValue, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, setValue, OrderedSubject as ɵa, InternalActions as ɵb, ROOT_STATE_TOKEN as ɵc, FEATURE_STATE_TOKEN as ɵd, SELECTOR_META_KEY as ɵe, NgxsConfig as ɵf, mergeDeep as ɵg,
|
|
4063
|
+
export { Action, Actions, InitState, NGXS_PLUGINS, NgxsModule, NgxsSimpleChange, NoopNgxsExecutionStrategy, Select, Selector, SelectorOptions, State, StateStream, StateToken, Store, UpdateState, actionMatcher, createSelector, ensureSelectorMetadata$1 as ensureSelectorMetadata, ensureStoreMetadata$1 as ensureStoreMetadata, getActionTypeFromInstance, getSelectorMetadata$1 as getSelectorMetadata, getStoreMetadata$1 as getStoreMetadata, getValue, ofAction, ofActionCanceled, ofActionCompleted, ofActionDispatched, ofActionErrored, ofActionSuccessful, setValue, OrderedSubject as ɵa, InternalActions as ɵb, ROOT_STATE_TOKEN as ɵc, FEATURE_STATE_TOKEN as ɵd, SELECTOR_META_KEY as ɵe, NgxsConfig as ɵf, mergeDeep as ɵg, USER_PROVIDED_NGXS_EXECUTION_STRATEGY as ɵh, NGXS_EXECUTION_STRATEGY as ɵi, NgxsRootModule as ɵj, StateFactory as ɵk, InternalDispatchedActionResults as ɵl, InternalDispatcher as ɵm, StateContextFactory as ɵn, InternalStateOperations as ɵo, PluginManager as ɵp, InternalNgxsExecutionStrategy as ɵq, ensureStoreMetadata as ɵs, getStoreMetadata as ɵt, ensureSelectorMetadata as ɵu, getSelectorMetadata as ɵv, LifecycleStateManager as ɵw, NgxsFeatureModule as ɵx };
|
|
4032
4064
|
//# sourceMappingURL=ngxs-store.js.map
|