@hairy/react-lib 1.17.0 → 1.18.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 CHANGED
@@ -446,10 +446,12 @@ function track(action, status) {
446
446
  tracking();
447
447
  try {
448
448
  const result = action(...args);
449
- if (result instanceof Promise)
450
- result.then(fulfilled).catch(rejected);
451
- else
449
+ if (result instanceof Promise) {
450
+ return result.then(fulfilled).catch(rejected);
451
+ } else {
452
452
  fulfilled();
453
+ return result;
454
+ }
453
455
  } catch (error) {
454
456
  rejected(error);
455
457
  }
@@ -1057,10 +1057,12 @@ var LibReact = (() => {
1057
1057
  tracking();
1058
1058
  try {
1059
1059
  const result = action(...args);
1060
- if (result instanceof Promise)
1061
- result.then(fulfilled).catch(rejected);
1062
- else
1060
+ if (result instanceof Promise) {
1061
+ return result.then(fulfilled).catch(rejected);
1062
+ } else {
1063
1063
  fulfilled();
1064
+ return result;
1065
+ }
1064
1066
  } catch (error) {
1065
1067
  rejected(error);
1066
1068
  }
package/dist/index.js CHANGED
@@ -386,10 +386,12 @@ function track(action, status) {
386
386
  tracking();
387
387
  try {
388
388
  const result = action(...args);
389
- if (result instanceof Promise)
390
- result.then(fulfilled).catch(rejected);
391
- else
389
+ if (result instanceof Promise) {
390
+ return result.then(fulfilled).catch(rejected);
391
+ } else {
392
392
  fulfilled();
393
+ return result;
394
+ }
393
395
  } catch (error) {
394
396
  rejected(error);
395
397
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hairy/react-lib",
3
3
  "type": "module",
4
- "version": "1.17.0",
4
+ "version": "1.18.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.17.0"
41
+ "@hairy/utils": "1.18.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsup",