@ngxs/store 3.7.6-dev.master-2d80aec → 3.7.6-dev.master-4d7e301
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.umd.js +16 -14
- package/bundles/ngxs-store.umd.js.map +1 -1
- package/esm2015/src/decorators/selector/selector.js +6 -6
- package/esm2015/src/decorators/selector-options.js +2 -1
- package/esm2015/src/internal/state-operators.js +11 -10
- package/fesm2015/ngxs-store.js +16 -14
- package/fesm2015/ngxs-store.js.map +1 -1
- package/package.json +1 -1
- package/src/internal/state-operators.d.ts +1 -1
|
@@ -1538,19 +1538,20 @@
|
|
|
1538
1538
|
type: i0.Injectable
|
|
1539
1539
|
}], ctorParameters: function () { return [{ type: InternalActions }, { type: InternalDispatchedActionResults }, { type: PluginManager }, { type: StateStream }, { type: InternalNgxsExecutionStrategy }, { type: InternalErrorReporter }]; } });
|
|
1540
1540
|
|
|
1541
|
-
function simplePatch(
|
|
1541
|
+
function simplePatch(value) {
|
|
1542
1542
|
return function (existingState) {
|
|
1543
|
-
if (
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1543
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
1544
|
+
if (Array.isArray(value)) {
|
|
1545
|
+
throwPatchingArrayError();
|
|
1546
|
+
}
|
|
1547
|
+
else if (typeof value !== 'object') {
|
|
1548
|
+
throwPatchingPrimitiveError();
|
|
1549
|
+
}
|
|
1548
1550
|
}
|
|
1549
1551
|
var newState = Object.assign({}, existingState);
|
|
1550
|
-
for (var key in
|
|
1552
|
+
for (var key in value) {
|
|
1551
1553
|
// deep clone for patch compatibility
|
|
1552
|
-
|
|
1553
|
-
newState[key] = val[key];
|
|
1554
|
+
newState[key] = value[key];
|
|
1554
1555
|
}
|
|
1555
1556
|
return newState;
|
|
1556
1557
|
};
|
|
@@ -2667,6 +2668,7 @@
|
|
|
2667
2668
|
function SelectorOptions(options) {
|
|
2668
2669
|
return (function decorate(target, methodName, descriptor) {
|
|
2669
2670
|
if (methodName) {
|
|
2671
|
+
descriptor || (descriptor = Object.getOwnPropertyDescriptor(target, methodName));
|
|
2670
2672
|
// Method Decorator
|
|
2671
2673
|
var originalFn = descriptor.value || descriptor.originalFn;
|
|
2672
2674
|
if (originalFn) {
|
|
@@ -2698,27 +2700,27 @@
|
|
|
2698
2700
|
*/
|
|
2699
2701
|
function Selector(selectors) {
|
|
2700
2702
|
return function (target, key, descriptor) {
|
|
2703
|
+
descriptor || (descriptor = Object.getOwnPropertyDescriptor(target, key));
|
|
2704
|
+
var originalFn = descriptor === null || descriptor === void 0 ? void 0 : descriptor.value;
|
|
2701
2705
|
// Caretaker note: we have still left the `typeof` condition in order to avoid
|
|
2702
2706
|
// creating a breaking change for projects that still use the View Engine.
|
|
2703
2707
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
2704
|
-
|
|
2705
|
-
if (isNotMethod) {
|
|
2708
|
+
if (originalFn && typeof originalFn !== 'function') {
|
|
2706
2709
|
throwSelectorDecoratorError();
|
|
2707
2710
|
}
|
|
2708
2711
|
}
|
|
2709
|
-
var originalFn = descriptor.value;
|
|
2710
2712
|
var memoizedFn = createSelector(selectors, originalFn, {
|
|
2711
2713
|
containerClass: target,
|
|
2712
2714
|
selectorName: key.toString(),
|
|
2713
2715
|
getSelectorOptions: function () {
|
|
2714
2716
|
return {};
|
|
2715
|
-
}
|
|
2717
|
+
},
|
|
2716
2718
|
});
|
|
2717
2719
|
var newDescriptor = {
|
|
2718
2720
|
configurable: true,
|
|
2719
2721
|
get: function () {
|
|
2720
2722
|
return memoizedFn;
|
|
2721
|
-
}
|
|
2723
|
+
},
|
|
2722
2724
|
};
|
|
2723
2725
|
// Add hidden property to descriptor
|
|
2724
2726
|
newDescriptor['originalFn'] = originalFn;
|