@ngxs/store 3.8.2-dev.master-e341d41 → 3.8.2-dev.master-9e80885
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/esm2022/internals/initial-state.mjs +2 -2
- package/esm2022/internals/internal-tokens.mjs +2 -2
- package/esm2022/plugins/symbols.mjs +2 -2
- package/esm2022/src/decorators/action.mjs +2 -4
- package/esm2022/src/decorators/selector/selector.mjs +2 -4
- package/esm2022/src/decorators/state.mjs +2 -2
- package/esm2022/src/dev-features/symbols.mjs +2 -2
- package/esm2022/src/execution/dispatch-outside-zone-ngxs-execution-strategy.mjs +2 -4
- package/esm2022/src/execution/symbols.mjs +2 -2
- package/esm2022/src/internal/dispatcher.mjs +2 -2
- package/esm2022/src/internal/internals.mjs +4 -8
- package/esm2022/src/internal/lifecycle-state-manager.mjs +2 -2
- package/esm2022/src/internal/state-factory.mjs +2 -2
- package/esm2022/src/internal/state-operations.mjs +2 -2
- package/esm2022/src/internal/state-operators.mjs +2 -2
- package/esm2022/src/selectors/create-model-selector.mjs +2 -2
- package/esm2022/src/selectors/create-pick-selector.mjs +2 -2
- package/esm2022/src/selectors/create-property-selectors.mjs +2 -2
- package/esm2022/src/standalone-features/initializers.mjs +2 -2
- package/esm2022/src/symbols.mjs +2 -2
- package/fesm2022/ngxs-store-internals.mjs +2 -2
- package/fesm2022/ngxs-store-internals.mjs.map +1 -1
- package/fesm2022/ngxs-store-plugins.mjs +1 -1
- package/fesm2022/ngxs-store-plugins.mjs.map +1 -1
- package/fesm2022/ngxs-store.mjs +19 -29
- package/fesm2022/ngxs-store.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2022/ngxs-store.mjs
CHANGED
|
@@ -77,9 +77,7 @@ class DispatchOutsideZoneNgxsExecutionStrategy {
|
|
|
77
77
|
constructor(_ngZone, _platformId) {
|
|
78
78
|
this._ngZone = _ngZone;
|
|
79
79
|
this._platformId = _platformId;
|
|
80
|
-
|
|
81
|
-
// creating a breaking change for projects that still use the View Engine.
|
|
82
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
80
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
83
81
|
verifyZoneIsNotNooped(_ngZone);
|
|
84
82
|
}
|
|
85
83
|
}
|
|
@@ -126,7 +124,7 @@ function verifyZoneIsNotNooped(ngZone) {
|
|
|
126
124
|
console.warn(getZoneWarningMessage());
|
|
127
125
|
}
|
|
128
126
|
|
|
129
|
-
const NG_DEV_MODE$7 = typeof ngDevMode
|
|
127
|
+
const NG_DEV_MODE$7 = typeof ngDevMode !== 'undefined' && ngDevMode;
|
|
130
128
|
/**
|
|
131
129
|
* Consumers have the option to utilize the execution strategy provided by
|
|
132
130
|
* `NgxsModule.forRoot({executionStrategy})` or `provideStore([], {executionStrategy})`.
|
|
@@ -398,7 +396,7 @@ class InternalDispatcher {
|
|
|
398
396
|
}
|
|
399
397
|
}
|
|
400
398
|
dispatchSingle(action) {
|
|
401
|
-
if (typeof ngDevMode
|
|
399
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
402
400
|
const type = getActionTypeFromInstance(action);
|
|
403
401
|
if (!type) {
|
|
404
402
|
const error = new Error(`This action doesn't have a type property: ${action.constructor.name}`);
|
|
@@ -447,7 +445,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
447
445
|
args: [{ providedIn: 'root' }]
|
|
448
446
|
}], ctorParameters: () => [{ type: InternalActions }, { type: InternalDispatchedActionResults }, { type: PluginManager }, { type: i1.ɵStateStream }, { type: InternalNgxsExecutionStrategy }, { type: InternalErrorReporter }] });
|
|
449
447
|
|
|
450
|
-
const NG_DEV_MODE$6 = typeof ngDevMode
|
|
448
|
+
const NG_DEV_MODE$6 = typeof ngDevMode !== 'undefined' && ngDevMode;
|
|
451
449
|
// The injection token is used to resolve a list of states provided at
|
|
452
450
|
// the root level through either `NgxsModule.forRoot` or `provideStore`.
|
|
453
451
|
const ROOT_STATE_TOKEN = new InjectionToken(NG_DEV_MODE$6 ? 'ROOT_STATE_TOKEN' : '');
|
|
@@ -569,7 +567,7 @@ class InternalStateOperations {
|
|
|
569
567
|
setState: (newState) => this._stateStream.next(newState),
|
|
570
568
|
dispatch: (actionOrActions) => this._dispatcher.dispatch(actionOrActions)
|
|
571
569
|
};
|
|
572
|
-
if (typeof ngDevMode
|
|
570
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
573
571
|
return this._config.developmentMode
|
|
574
572
|
? ensureStateAndActionsAreImmutable(rootStateOperations)
|
|
575
573
|
: rootStateOperations;
|
|
@@ -699,7 +697,7 @@ function getRootSelectorFactory(selector) {
|
|
|
699
697
|
return (metadata && metadata.makeRootSelector) || (() => selector);
|
|
700
698
|
}
|
|
701
699
|
|
|
702
|
-
const NG_DEV_MODE$4 = typeof ngDevMode
|
|
700
|
+
const NG_DEV_MODE$4 = typeof ngDevMode !== 'undefined' && ngDevMode;
|
|
703
701
|
/**
|
|
704
702
|
* Get a deeply nested value. Example:
|
|
705
703
|
*
|
|
@@ -791,9 +789,7 @@ const ɵPROP_GETTER = new InjectionToken(NG_DEV_MODE$4 ? 'PROP_GETTER' : '', {
|
|
|
791
789
|
function buildGraph(stateClasses) {
|
|
792
790
|
const findName = (stateClass) => {
|
|
793
791
|
const meta = stateClasses.find(g => g === stateClass);
|
|
794
|
-
|
|
795
|
-
// creating a breaking change for projects that still use the View Engine.
|
|
796
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && !meta) {
|
|
792
|
+
if (NG_DEV_MODE$4 && !meta) {
|
|
797
793
|
throw new Error(`Child state not found: ${stateClass}. \r\nYou may have forgotten to add states to module`);
|
|
798
794
|
}
|
|
799
795
|
return meta[_META_KEY].name;
|
|
@@ -888,9 +884,7 @@ function topologicalSort(graph) {
|
|
|
888
884
|
ancestors.push(name);
|
|
889
885
|
visited[name] = true;
|
|
890
886
|
graph[name].forEach((dep) => {
|
|
891
|
-
|
|
892
|
-
// creating a breaking change for projects that still use the View Engine.
|
|
893
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && ancestors.indexOf(dep) >= 0) {
|
|
887
|
+
if (NG_DEV_MODE$4 && ancestors.indexOf(dep) >= 0) {
|
|
894
888
|
throw new Error(`Circular dependency '${dep}' is required by '${name}': ${ancestors.join(' -> ')}`);
|
|
895
889
|
}
|
|
896
890
|
if (visited[dep]) {
|
|
@@ -1010,7 +1004,7 @@ function createAllowedStatusesMap(statuses) {
|
|
|
1010
1004
|
|
|
1011
1005
|
function simplePatch(value) {
|
|
1012
1006
|
return (existingState) => {
|
|
1013
|
-
if (typeof ngDevMode
|
|
1007
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
1014
1008
|
if (Array.isArray(value)) {
|
|
1015
1009
|
throwPatchingArrayError();
|
|
1016
1010
|
}
|
|
@@ -1138,7 +1132,7 @@ function jit_hasInjectableAnnotation(stateClass) {
|
|
|
1138
1132
|
return annotations.some((annotation) => annotation?.ngMetadataName === 'Injectable');
|
|
1139
1133
|
}
|
|
1140
1134
|
|
|
1141
|
-
const NG_DEV_MODE$3 = typeof ngDevMode
|
|
1135
|
+
const NG_DEV_MODE$3 = typeof ngDevMode !== 'undefined' && ngDevMode;
|
|
1142
1136
|
const NGXS_DEVELOPMENT_OPTIONS = new InjectionToken(NG_DEV_MODE$3 ? 'NGXS_DEVELOPMENT_OPTIONS' : '', {
|
|
1143
1137
|
providedIn: 'root',
|
|
1144
1138
|
factory: () => ({ warnOnUnhandledActions: true })
|
|
@@ -1185,7 +1179,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
1185
1179
|
args: [NGXS_DEVELOPMENT_OPTIONS]
|
|
1186
1180
|
}] }] });
|
|
1187
1181
|
|
|
1188
|
-
const NG_DEV_MODE$2 = typeof ngDevMode
|
|
1182
|
+
const NG_DEV_MODE$2 = typeof ngDevMode !== 'undefined' && ngDevMode;
|
|
1189
1183
|
function cloneDefaults(defaults) {
|
|
1190
1184
|
let value = defaults === undefined ? {} : defaults;
|
|
1191
1185
|
if (defaults) {
|
|
@@ -1589,7 +1583,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
1589
1583
|
args: [{ providedIn: 'root' }]
|
|
1590
1584
|
}], ctorParameters: () => [{ type: Store }, { type: NgxsConfig }] });
|
|
1591
1585
|
|
|
1592
|
-
const NG_DEV_MODE$1 = typeof ngDevMode
|
|
1586
|
+
const NG_DEV_MODE$1 = typeof ngDevMode !== 'undefined' && ngDevMode;
|
|
1593
1587
|
class LifecycleStateManager {
|
|
1594
1588
|
constructor(_store, _internalErrorReporter, _internalStateOperations, _stateContextFactory, _appBootstrappedState) {
|
|
1595
1589
|
this._store = _store;
|
|
@@ -1668,7 +1662,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
1668
1662
|
args: [{ providedIn: 'root' }]
|
|
1669
1663
|
}], ctorParameters: () => [{ type: Store }, { type: InternalErrorReporter }, { type: InternalStateOperations }, { type: StateContextFactory }, { type: i1.ɵNgxsAppBootstrappedState }] });
|
|
1670
1664
|
|
|
1671
|
-
const NG_DEV_MODE = typeof ngDevMode
|
|
1665
|
+
const NG_DEV_MODE = typeof ngDevMode !== 'undefined' && ngDevMode;
|
|
1672
1666
|
/**
|
|
1673
1667
|
* This function is shared by both NgModule and standalone features.
|
|
1674
1668
|
* When using `NgxsModule.forRoot` and `provideStore`, we can depend on the
|
|
@@ -1859,9 +1853,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
|
|
|
1859
1853
|
*/
|
|
1860
1854
|
function Action(actions, options) {
|
|
1861
1855
|
return (target, name) => {
|
|
1862
|
-
|
|
1863
|
-
// creating a breaking change for projects that still use the View Engine.
|
|
1864
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
1856
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
1865
1857
|
const isStaticMethod = target.hasOwnProperty('prototype');
|
|
1866
1858
|
if (isStaticMethod) {
|
|
1867
1859
|
throwActionDecoratorError();
|
|
@@ -1906,7 +1898,7 @@ function mutateMetaData(params) {
|
|
|
1906
1898
|
const { meta, inheritedStateClass, optionsWithInheritance } = params;
|
|
1907
1899
|
const { children, defaults, name } = optionsWithInheritance;
|
|
1908
1900
|
const stateName = typeof name === 'string' ? name : (name && name.getName()) || null;
|
|
1909
|
-
if (typeof ngDevMode
|
|
1901
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
1910
1902
|
ensureStateNameIsValid(stateName);
|
|
1911
1903
|
}
|
|
1912
1904
|
if (inheritedStateClass.hasOwnProperty(_META_KEY)) {
|
|
@@ -2037,9 +2029,7 @@ function Selector(selectors) {
|
|
|
2037
2029
|
return (target, key, descriptor) => {
|
|
2038
2030
|
descriptor ||= Object.getOwnPropertyDescriptor(target, key);
|
|
2039
2031
|
const originalFn = descriptor?.value;
|
|
2040
|
-
|
|
2041
|
-
// creating a breaking change for projects that still use the View Engine.
|
|
2042
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
2032
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
2043
2033
|
if (originalFn && typeof originalFn !== 'function') {
|
|
2044
2034
|
throwSelectorDecoratorError();
|
|
2045
2035
|
}
|
|
@@ -2106,7 +2096,7 @@ function ensureValueProvided(value, context = {}) {
|
|
|
2106
2096
|
function createModelSelector(selectorMap) {
|
|
2107
2097
|
const selectorKeys = Object.keys(selectorMap);
|
|
2108
2098
|
const selectors = Object.values(selectorMap);
|
|
2109
|
-
if (typeof ngDevMode
|
|
2099
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
2110
2100
|
ensureValidSelectorMap({
|
|
2111
2101
|
prefix: '[createModelSelector]',
|
|
2112
2102
|
selectorMap,
|
|
@@ -2132,7 +2122,7 @@ function ensureValidSelectorMap({ prefix, selectorMap, selectorKeys, selectors }
|
|
|
2132
2122
|
}
|
|
2133
2123
|
|
|
2134
2124
|
function createPickSelector(selector, keys) {
|
|
2135
|
-
if (typeof ngDevMode
|
|
2125
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
2136
2126
|
ensureValidSelector(selector, { prefix: '[createPickSelector]' });
|
|
2137
2127
|
}
|
|
2138
2128
|
const validKeys = keys.filter(Boolean);
|
|
@@ -2146,7 +2136,7 @@ function createPickSelector(selector, keys) {
|
|
|
2146
2136
|
}
|
|
2147
2137
|
|
|
2148
2138
|
function createPropertySelectors(parentSelector) {
|
|
2149
|
-
if (typeof ngDevMode
|
|
2139
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
2150
2140
|
ensureValidSelector(parentSelector, {
|
|
2151
2141
|
prefix: '[createPropertySelectors]',
|
|
2152
2142
|
noun: 'parent selector'
|