@ngrx-traits/common 14.1.1-beta.1 → 15.0.0-beta.1
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.
|
@@ -1577,16 +1577,11 @@ function addAsyncActionTrait({ name, actionProps, actionSuccessProps, actionFail
|
|
|
1577
1577
|
? createAction(`${actionsGroupKey} ${nameAsSentence} Failure`, actionFailProps)
|
|
1578
1578
|
: createAction(`${actionsGroupKey} ${nameAsSentence} Failure`)),
|
|
1579
1579
|
};
|
|
1580
|
-
//TypeScript error after migration to 4.9.5
|
|
1581
|
-
//Removed because 'name' is not optional
|
|
1582
|
-
//if (name) {
|
|
1583
1580
|
return {
|
|
1584
1581
|
[`${name}`]: internalActions.request,
|
|
1585
1582
|
[`${name}Success`]: internalActions.requestSuccess,
|
|
1586
1583
|
[`${name}Fail`]: internalActions.requestFail,
|
|
1587
1584
|
};
|
|
1588
|
-
//}
|
|
1589
|
-
//return internalActions;
|
|
1590
1585
|
},
|
|
1591
1586
|
selectors: () => {
|
|
1592
1587
|
function isLoadingEntity(state) {
|
|
@@ -1611,19 +1606,17 @@ function addAsyncActionTrait({ name, actionProps, actionSuccessProps, actionFail
|
|
|
1611
1606
|
// Added 'any' to 'state' and removed 'as AsyncActionState<J>'
|
|
1612
1607
|
// because OnReducer have a weird type for the state.
|
|
1613
1608
|
// TODO: Investigate if possible to remove the 'any' type and have better type safety
|
|
1609
|
+
// tried remove the any seems to be a problex with ngrx on making the state unknown
|
|
1614
1610
|
return createReducer(initialState, on(internalActions.request, (state) => ({
|
|
1615
1611
|
...state,
|
|
1616
1612
|
[`${name}Status`]: 'loading',
|
|
1617
|
-
})
|
|
1618
|
-
), on(internalActions.requestFail, (state) => ({
|
|
1613
|
+
})), on(internalActions.requestFail, (state) => ({
|
|
1619
1614
|
...state,
|
|
1620
1615
|
[`${name}Status`]: 'fail',
|
|
1621
|
-
})
|
|
1622
|
-
), on(internalActions.requestSuccess, (state) => ({
|
|
1616
|
+
})), on(internalActions.requestSuccess, (state) => ({
|
|
1623
1617
|
...state,
|
|
1624
1618
|
[`${name}Status`]: 'success',
|
|
1625
|
-
})
|
|
1626
|
-
));
|
|
1619
|
+
})));
|
|
1627
1620
|
},
|
|
1628
1621
|
});
|
|
1629
1622
|
}
|