@wzyjs/hooks 0.0.18 → 0.0.22
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/dist/useEffectValue.d.ts
CHANGED
package/dist/useRequestPro.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ interface UserOptions<P extends any[], R> extends Options<R, P> {
|
|
|
7
7
|
interface IResult<R extends RequestRes, P extends any[]> extends Omit<Result<R, P>, 'data'> {
|
|
8
8
|
data?: R['data'];
|
|
9
9
|
}
|
|
10
|
-
export declare const useRequestPro: <P extends any[], R extends RequestRes<any>>(reqPromise
|
|
10
|
+
export declare const useRequestPro: <P extends any[], R extends RequestRes<any>>(reqPromise?: Service<R, P> | undefined, userOptions?: UserOptions<P, R> | undefined) => IResult<R, P> | null;
|
|
11
11
|
export {};
|
package/dist/useRequestPro.js
CHANGED
|
@@ -2,6 +2,9 @@ import { message } from 'antd';
|
|
|
2
2
|
import { omit } from '@wzyjs/utils';
|
|
3
3
|
import { useRequest } from 'ahooks';
|
|
4
4
|
export const useRequestPro = (reqPromise, userOptions) => {
|
|
5
|
+
if (!reqPromise) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
5
8
|
const { alertErrorMessage = true, alertSuccessMessage = false } = userOptions || {};
|
|
6
9
|
const defaultOptions = {
|
|
7
10
|
debounceWait: 300,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wzyjs/hooks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "description",
|
|
5
5
|
"author": "wzy",
|
|
6
6
|
"license": "ISC",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@types/react": "^18.0.28",
|
|
18
|
-
"@wzyjs/utils": "^0.0.
|
|
18
|
+
"@wzyjs/utils": "^0.0.22",
|
|
19
19
|
"ahooks": "^3.7.3",
|
|
20
20
|
"antd": "^5.1.0",
|
|
21
21
|
"react-use": "^17.4.0"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"type": "git",
|
|
35
35
|
"url": "https://gitee.com/wang-zhenyu/work.git"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "83f4f72a07a490ee3b07484562b3e1a94e52c162"
|
|
38
38
|
}
|