@unitedstatespowersquadrons/components 1.2.7-pre.1 → 1.2.7-pre.2
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/Reducer/buildReducer.tsx +9 -0
- package/package.json +2 -1
package/Reducer/buildReducer.tsx
CHANGED
|
@@ -52,6 +52,14 @@ export default function buildReducer<AppState, AppAction>(
|
|
|
52
52
|
return context;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
function useAppCable() {
|
|
56
|
+
const context = useContext(CableContext);
|
|
57
|
+
if (!context) {
|
|
58
|
+
throw new Error("useAppCable has to be used within AppProvider");
|
|
59
|
+
}
|
|
60
|
+
return context;
|
|
61
|
+
}
|
|
62
|
+
|
|
55
63
|
function useAppDispatch() {
|
|
56
64
|
const context = useContext(DispatchContext);
|
|
57
65
|
if (!context) {
|
|
@@ -62,6 +70,7 @@ export default function buildReducer<AppState, AppAction>(
|
|
|
62
70
|
|
|
63
71
|
return {
|
|
64
72
|
AppProvider,
|
|
73
|
+
useAppCable,
|
|
65
74
|
useAppDispatch,
|
|
66
75
|
useAppState,
|
|
67
76
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unitedstatespowersquadrons/components",
|
|
3
|
-
"version": "1.2.7-pre.
|
|
3
|
+
"version": "1.2.7-pre.2",
|
|
4
4
|
"description": "USPS shared React components library",
|
|
5
5
|
"main": "index.tsx",
|
|
6
6
|
"scripts": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@rails/actioncable": "^8.0.200",
|
|
21
21
|
"@types/actioncable": "^5.2.11",
|
|
22
|
+
"actioncable": "^5.2.8-1",
|
|
22
23
|
"classnames": "^2.5.1",
|
|
23
24
|
"immer": "^10.1.1",
|
|
24
25
|
"react": "^19.1.0",
|