@lemon-fe/hooks 0.1.146 → 0.1.148
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/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/useRequest/index.js +8 -8
- package/package.json +2 -2
package/es/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { default as usePrimaryColor } from './usePrimaryColor';
|
|
|
5
5
|
export { default as useRequest } from './useRequest';
|
|
6
6
|
export { default as useAsyncEffect } from './useAsyncEffect';
|
|
7
7
|
export { default as usePreload } from './usePreload';
|
|
8
|
+
export { default as useUpdateEffect } from './useUpdateEffect';
|
|
8
9
|
export { config } from './config';
|
package/es/index.js
CHANGED
|
@@ -5,4 +5,5 @@ export { default as usePrimaryColor } from './usePrimaryColor';
|
|
|
5
5
|
export { default as useRequest } from './useRequest';
|
|
6
6
|
export { default as useAsyncEffect } from './useAsyncEffect';
|
|
7
7
|
export { default as usePreload } from './usePreload';
|
|
8
|
+
export { default as useUpdateEffect } from './useUpdateEffect';
|
|
8
9
|
export { config } from './config';
|
package/es/useRequest/index.js
CHANGED
|
@@ -90,28 +90,28 @@ export default function useRequest(request) {
|
|
|
90
90
|
return request.apply(void 0, _args);
|
|
91
91
|
case 6:
|
|
92
92
|
res = _context.sent;
|
|
93
|
-
if (mounted.current && id === fetchId.current
|
|
94
|
-
|
|
93
|
+
if (mounted.current && id === fetchId.current) {
|
|
94
|
+
end();
|
|
95
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(res);
|
|
96
|
+
} else if (!mounted.current) {
|
|
97
|
+
end();
|
|
95
98
|
}
|
|
96
99
|
return _context.abrupt("return", res);
|
|
97
100
|
case 11:
|
|
98
101
|
_context.prev = 11;
|
|
99
102
|
_context.t0 = _context["catch"](3);
|
|
103
|
+
end();
|
|
100
104
|
if (onError) {
|
|
101
105
|
onError(_context.t0);
|
|
102
106
|
} else {
|
|
103
107
|
hooksOpts.showError(_context.t0);
|
|
104
108
|
}
|
|
105
|
-
case
|
|
106
|
-
_context.prev = 14;
|
|
107
|
-
end();
|
|
108
|
-
return _context.finish(14);
|
|
109
|
-
case 17:
|
|
109
|
+
case 15:
|
|
110
110
|
case "end":
|
|
111
111
|
return _context.stop();
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
}, _callee, null, [[3, 11
|
|
114
|
+
}, _callee, null, [[3, 11]]);
|
|
115
115
|
}));
|
|
116
116
|
return function run() {
|
|
117
117
|
return _ref.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/hooks",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.148",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "鲁盛杰 <lusj@cnlemon.net>",
|
|
6
6
|
"homepage": "",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"@types/color-string": "^1.5.2",
|
|
27
27
|
"react": "^17.0.2"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "977c1f1312e17042367301507829424ac7e075e7"
|
|
30
30
|
}
|