ag-common 0.0.413 → 0.0.414
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.
|
@@ -36,13 +36,13 @@ const useCallOpenApi = (pIn) => {
|
|
|
36
36
|
setData([pIn, defaultState(pIn, true)]);
|
|
37
37
|
}
|
|
38
38
|
}, [data, pIn]);
|
|
39
|
-
const
|
|
39
|
+
const reFetch = (0, react_1.useCallback)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
40
|
const resp = yield (0, direct_1.callOpenApi)(data[0]);
|
|
41
41
|
setData((d) => [
|
|
42
42
|
d[0],
|
|
43
43
|
Object.assign(Object.assign({}, resp), { loaded: true, loading: false, loadcount: d[1].loadcount + 1, url: '', datetime: new Date().getTime() }),
|
|
44
44
|
]);
|
|
45
|
-
}), [data]);
|
|
45
|
+
}), [data, setData]);
|
|
46
46
|
(0, react_1.useEffect)(() => {
|
|
47
47
|
const { error, loaded, loading, loadcount } = data[1];
|
|
48
48
|
const ng = data[0].disabled || loaded || loading || (error && loadcount > 2);
|
|
@@ -50,9 +50,9 @@ const useCallOpenApi = (pIn) => {
|
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
setData((d) => [d[0], Object.assign(Object.assign({}, d[1]), { loading: true })]);
|
|
53
|
-
void
|
|
54
|
-
}, [data,
|
|
55
|
-
const ret = Object.assign(Object.assign({}, data[1]), { reFetch
|
|
53
|
+
void reFetch();
|
|
54
|
+
}, [data, reFetch, setData]);
|
|
55
|
+
const ret = Object.assign(Object.assign({}, data[1]), { reFetch, setData: (d) => {
|
|
56
56
|
setData([
|
|
57
57
|
data[0],
|
|
58
58
|
Object.assign(Object.assign({}, data[1]), { data: d(data[1].data), datetime: new Date().getTime() }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ag-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.414",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"author": "Andrei Gec <@andreigec> (https://gec.dev/)",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
"aws-sdk": "2.x",
|
|
20
20
|
"axios": "1.x",
|
|
21
21
|
"constructs": "10.x",
|
|
22
|
+
"eslint-import-resolver-typescript": ">=3",
|
|
23
|
+
"eslint-plugin-simple-import-sort": ">=10",
|
|
22
24
|
"jsonwebtoken": "9.x",
|
|
23
25
|
"jwks-rsa": "3.x",
|
|
24
26
|
"node-cache": "5.x",
|
|
25
|
-
"openapi-request-validator": "12.
|
|
26
|
-
"react": "18.
|
|
27
|
-
"react-dom": "18.
|
|
28
|
-
"typescript": "4.x"
|
|
29
|
-
"eslint-import-resolver-typescript": "3.x",
|
|
30
|
-
"eslint-plugin-simple-import-sort": ">=8"
|
|
27
|
+
"openapi-request-validator": "12.x",
|
|
28
|
+
"react": "18.x",
|
|
29
|
+
"react-dom": "18.x",
|
|
30
|
+
"typescript": "4.x"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@emotion/react": "
|
|
34
|
-
"@emotion/styled": "
|
|
33
|
+
"@emotion/react": ">=11",
|
|
34
|
+
"@emotion/styled": ">=11"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/core": "7.20.12",
|