@hairy/react-lib 1.21.0 → 1.22.0
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/index.cjs +1 -0
- package/dist/index.global.js +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -207,6 +207,7 @@ var import_react7 = require("react");
|
|
|
207
207
|
function useAsyncCallback(fun) {
|
|
208
208
|
const [state, set] = (0, import_react7.useState)({ loading: false });
|
|
209
209
|
async function execute(...args) {
|
|
210
|
+
set({ loading: true });
|
|
210
211
|
return fun(...args).then((value) => {
|
|
211
212
|
set({ loading: false });
|
|
212
213
|
return value;
|
package/dist/index.global.js
CHANGED
|
@@ -310,6 +310,7 @@ var LibReact = (() => {
|
|
|
310
310
|
function useAsyncCallback(fun) {
|
|
311
311
|
const [state, set] = (0, import_react7.useState)({ loading: false });
|
|
312
312
|
async function execute(...args) {
|
|
313
|
+
set({ loading: true });
|
|
313
314
|
return fun(...args).then((value) => {
|
|
314
315
|
set({ loading: false });
|
|
315
316
|
return value;
|
package/dist/index.js
CHANGED
|
@@ -147,6 +147,7 @@ import { useState } from "react";
|
|
|
147
147
|
function useAsyncCallback(fun) {
|
|
148
148
|
const [state, set] = useState({ loading: false });
|
|
149
149
|
async function execute(...args) {
|
|
150
|
+
set({ loading: true });
|
|
150
151
|
return fun(...args).then((value) => {
|
|
151
152
|
set({ loading: false });
|
|
152
153
|
return value;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hairy/react-lib",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.22.0",
|
|
5
5
|
"description": "Library for react",
|
|
6
6
|
"author": "Hairyf <wwu710632@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react-dom": "^18.2.0",
|
|
39
39
|
"react-i18next": "^14.1.2",
|
|
40
40
|
"react-use": "^17.6.0",
|
|
41
|
-
"@hairy/utils": "1.
|
|
41
|
+
"@hairy/utils": "1.22.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsup",
|