@zohodesk/utils 1.0.5 → 1.0.8
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/README.md +1 -0
- package/es/reducerHandler.js +23 -15
- package/package.json +16 -7
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[Back To Docs List](..)
|
package/es/reducerHandler.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import { useReducer } from "react";
|
|
2
|
-
export default function useCommonReducer(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
// import { useReducer } from "react";
|
|
2
|
+
// export default function useCommonReducer(
|
|
3
|
+
// defaultReducer,
|
|
4
|
+
// customReducer,
|
|
5
|
+
// initialArg,
|
|
6
|
+
// init
|
|
7
|
+
// ) {
|
|
8
|
+
// const proxyReducer = (state, action) => {
|
|
9
|
+
// let lastState = defaultReducer(state, action);
|
|
10
|
+
|
|
11
|
+
// if (customReducer) {
|
|
12
|
+
// return customReducer(lastState, action);
|
|
13
|
+
// }
|
|
14
|
+
|
|
15
|
+
// return lastState;
|
|
16
|
+
// };
|
|
17
|
+
// const [state, dispatch] = useReducer(proxyReducer, initialArg, init);
|
|
18
|
+
|
|
19
|
+
// return {
|
|
20
|
+
// state,
|
|
21
|
+
// dispatch
|
|
22
|
+
// };
|
|
23
|
+
// }
|
package/package.json
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/utils",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"description": "Unified Component Library - Utils",
|
|
5
|
+
"main": "es/index.js",
|
|
6
|
+
"module": "es/index.js",
|
|
5
7
|
"private": false,
|
|
6
8
|
"publishConfig": {
|
|
7
9
|
"access": "public"
|
|
8
10
|
},
|
|
9
|
-
"
|
|
11
|
+
"author": "Z Team",
|
|
12
|
+
"homepage": "https://www.npmjs.com/search?q=@zohodesk",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"UCL",
|
|
16
|
+
"ZOHODESK",
|
|
17
|
+
"ZTEAM",
|
|
18
|
+
"LIBRARY"
|
|
19
|
+
],
|
|
10
20
|
"scripts": {
|
|
11
21
|
"build": "type react-cli && react-cli build:component:es",
|
|
12
22
|
"build_watch": "react-cli build:component:es -w",
|
|
@@ -14,13 +24,12 @@
|
|
|
14
24
|
"rtl": "react-cli rtl ./src ./es",
|
|
15
25
|
"nodefix": "node ../buildtool_patch.js",
|
|
16
26
|
"prepare": "npm run clean && npm run build && npm run rtl",
|
|
17
|
-
"test": "react-cli test"
|
|
27
|
+
"test": "react-cli test",
|
|
28
|
+
"jsdoc": "jsdoc -c jsdoc.json"
|
|
18
29
|
},
|
|
19
30
|
"files": [
|
|
20
31
|
"es",
|
|
21
32
|
"!**/__tests__"
|
|
22
33
|
],
|
|
23
|
-
"
|
|
24
|
-
"license": "ISC",
|
|
25
|
-
"gitHead": "cc656e6d4c2249ad79916757b2a96828b678245b"
|
|
34
|
+
"gitHead": "cbe8fa47807d6ef96e41bc64ba0a02089f90c428"
|
|
26
35
|
}
|