@trackunit/react-core-hooks 1.14.17 → 1.15.5
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/index.cjs.js +9 -15
- package/index.esm.js +9 -15
- package/package.json +4 -4
package/index.cjs.js
CHANGED
|
@@ -395,10 +395,7 @@ const useImageUploader = () => {
|
|
|
395
395
|
});
|
|
396
396
|
});
|
|
397
397
|
}, [token]);
|
|
398
|
-
return {
|
|
399
|
-
uploadImage,
|
|
400
|
-
loading,
|
|
401
|
-
};
|
|
398
|
+
return react.useMemo(() => ({ uploadImage, loading }), [uploadImage, loading]);
|
|
402
399
|
};
|
|
403
400
|
|
|
404
401
|
/**
|
|
@@ -456,10 +453,7 @@ const useIrisAppImage = () => {
|
|
|
456
453
|
const logoImageUrl = await fetchAssetBlobUrl(logoFetchUrl, headers);
|
|
457
454
|
return logoImageUrl;
|
|
458
455
|
}, [featureBranchQueryParam, headers]);
|
|
459
|
-
return {
|
|
460
|
-
getAppUrl,
|
|
461
|
-
getAppImage,
|
|
462
|
-
};
|
|
456
|
+
return react.useMemo(() => ({ getAppUrl, getAppImage }), [getAppUrl, getAppImage]);
|
|
463
457
|
};
|
|
464
458
|
|
|
465
459
|
/**
|
|
@@ -627,7 +621,7 @@ const useAssetRuntime = () => {
|
|
|
627
621
|
};
|
|
628
622
|
void getAssetInfo();
|
|
629
623
|
}, []);
|
|
630
|
-
return { assetInfo, loading, error };
|
|
624
|
+
return react.useMemo(() => ({ assetInfo, loading, error }), [assetInfo, loading, error]);
|
|
631
625
|
};
|
|
632
626
|
|
|
633
627
|
/**
|
|
@@ -666,7 +660,7 @@ const useCustomerRuntime = () => {
|
|
|
666
660
|
};
|
|
667
661
|
void getCustomerInfo();
|
|
668
662
|
}, []);
|
|
669
|
-
return { customerInfo, loading, error };
|
|
663
|
+
return react.useMemo(() => ({ customerInfo, loading, error }), [customerInfo, loading, error]);
|
|
670
664
|
};
|
|
671
665
|
|
|
672
666
|
const eventRuntimeReducer = (_state, action) => {
|
|
@@ -704,11 +698,11 @@ const useEventRuntime = () => {
|
|
|
704
698
|
.then(eventInfo => dispatch({ type: "success", eventInfo }))
|
|
705
699
|
.catch(() => dispatch({ type: "error", error: new Error("Failed to get event info") }));
|
|
706
700
|
}, []);
|
|
707
|
-
return {
|
|
701
|
+
return react.useMemo(() => ({
|
|
708
702
|
eventInfo: state.status === "success" ? state.eventInfo : undefined,
|
|
709
703
|
loading: state.status === "loading",
|
|
710
704
|
error: state.status === "error" ? state.error : undefined,
|
|
711
|
-
};
|
|
705
|
+
}), [state]);
|
|
712
706
|
};
|
|
713
707
|
|
|
714
708
|
/**
|
|
@@ -746,7 +740,7 @@ const useIrisAppName = () => {
|
|
|
746
740
|
};
|
|
747
741
|
void getAppName();
|
|
748
742
|
}, []);
|
|
749
|
-
return { appName, loading, error };
|
|
743
|
+
return react.useMemo(() => ({ appName, loading, error }), [appName, loading, error]);
|
|
750
744
|
};
|
|
751
745
|
/**
|
|
752
746
|
* A hook to expose irisAppId using ParamsRuntime's getAppName and getOrgName for React components
|
|
@@ -784,7 +778,7 @@ const useIrisAppId = () => {
|
|
|
784
778
|
};
|
|
785
779
|
void getData();
|
|
786
780
|
}, []);
|
|
787
|
-
return { irisAppId, loading, error };
|
|
781
|
+
return react.useMemo(() => ({ irisAppId, loading, error }), [irisAppId, loading, error]);
|
|
788
782
|
};
|
|
789
783
|
|
|
790
784
|
/**
|
|
@@ -823,7 +817,7 @@ const useSiteRuntime = () => {
|
|
|
823
817
|
};
|
|
824
818
|
void getSiteInfo();
|
|
825
819
|
}, []);
|
|
826
|
-
return { siteInfo, loading, error };
|
|
820
|
+
return react.useMemo(() => ({ siteInfo, loading, error }), [siteInfo, loading, error]);
|
|
827
821
|
};
|
|
828
822
|
|
|
829
823
|
/**
|
package/index.esm.js
CHANGED
|
@@ -393,10 +393,7 @@ const useImageUploader = () => {
|
|
|
393
393
|
});
|
|
394
394
|
});
|
|
395
395
|
}, [token]);
|
|
396
|
-
return {
|
|
397
|
-
uploadImage,
|
|
398
|
-
loading,
|
|
399
|
-
};
|
|
396
|
+
return useMemo(() => ({ uploadImage, loading }), [uploadImage, loading]);
|
|
400
397
|
};
|
|
401
398
|
|
|
402
399
|
/**
|
|
@@ -454,10 +451,7 @@ const useIrisAppImage = () => {
|
|
|
454
451
|
const logoImageUrl = await fetchAssetBlobUrl(logoFetchUrl, headers);
|
|
455
452
|
return logoImageUrl;
|
|
456
453
|
}, [featureBranchQueryParam, headers]);
|
|
457
|
-
return {
|
|
458
|
-
getAppUrl,
|
|
459
|
-
getAppImage,
|
|
460
|
-
};
|
|
454
|
+
return useMemo(() => ({ getAppUrl, getAppImage }), [getAppUrl, getAppImage]);
|
|
461
455
|
};
|
|
462
456
|
|
|
463
457
|
/**
|
|
@@ -625,7 +619,7 @@ const useAssetRuntime = () => {
|
|
|
625
619
|
};
|
|
626
620
|
void getAssetInfo();
|
|
627
621
|
}, []);
|
|
628
|
-
return { assetInfo, loading, error };
|
|
622
|
+
return useMemo(() => ({ assetInfo, loading, error }), [assetInfo, loading, error]);
|
|
629
623
|
};
|
|
630
624
|
|
|
631
625
|
/**
|
|
@@ -664,7 +658,7 @@ const useCustomerRuntime = () => {
|
|
|
664
658
|
};
|
|
665
659
|
void getCustomerInfo();
|
|
666
660
|
}, []);
|
|
667
|
-
return { customerInfo, loading, error };
|
|
661
|
+
return useMemo(() => ({ customerInfo, loading, error }), [customerInfo, loading, error]);
|
|
668
662
|
};
|
|
669
663
|
|
|
670
664
|
const eventRuntimeReducer = (_state, action) => {
|
|
@@ -702,11 +696,11 @@ const useEventRuntime = () => {
|
|
|
702
696
|
.then(eventInfo => dispatch({ type: "success", eventInfo }))
|
|
703
697
|
.catch(() => dispatch({ type: "error", error: new Error("Failed to get event info") }));
|
|
704
698
|
}, []);
|
|
705
|
-
return {
|
|
699
|
+
return useMemo(() => ({
|
|
706
700
|
eventInfo: state.status === "success" ? state.eventInfo : undefined,
|
|
707
701
|
loading: state.status === "loading",
|
|
708
702
|
error: state.status === "error" ? state.error : undefined,
|
|
709
|
-
};
|
|
703
|
+
}), [state]);
|
|
710
704
|
};
|
|
711
705
|
|
|
712
706
|
/**
|
|
@@ -744,7 +738,7 @@ const useIrisAppName = () => {
|
|
|
744
738
|
};
|
|
745
739
|
void getAppName();
|
|
746
740
|
}, []);
|
|
747
|
-
return { appName, loading, error };
|
|
741
|
+
return useMemo(() => ({ appName, loading, error }), [appName, loading, error]);
|
|
748
742
|
};
|
|
749
743
|
/**
|
|
750
744
|
* A hook to expose irisAppId using ParamsRuntime's getAppName and getOrgName for React components
|
|
@@ -782,7 +776,7 @@ const useIrisAppId = () => {
|
|
|
782
776
|
};
|
|
783
777
|
void getData();
|
|
784
778
|
}, []);
|
|
785
|
-
return { irisAppId, loading, error };
|
|
779
|
+
return useMemo(() => ({ irisAppId, loading, error }), [irisAppId, loading, error]);
|
|
786
780
|
};
|
|
787
781
|
|
|
788
782
|
/**
|
|
@@ -821,7 +815,7 @@ const useSiteRuntime = () => {
|
|
|
821
815
|
};
|
|
822
816
|
void getSiteInfo();
|
|
823
817
|
}, []);
|
|
824
|
-
return { siteInfo, loading, error };
|
|
818
|
+
return useMemo(() => ({ siteInfo, loading, error }), [siteInfo, loading, error]);
|
|
825
819
|
};
|
|
826
820
|
|
|
827
821
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-hooks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.5",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"es-toolkit": "^1.39.10",
|
|
11
|
-
"@trackunit/iris-app-runtime-core": "1.
|
|
12
|
-
"@trackunit/iris-app-runtime-core-api": "1.
|
|
13
|
-
"@trackunit/react-core-contexts-api": "1.
|
|
11
|
+
"@trackunit/iris-app-runtime-core": "1.15.4",
|
|
12
|
+
"@trackunit/iris-app-runtime-core-api": "1.14.4",
|
|
13
|
+
"@trackunit/react-core-contexts-api": "1.15.4"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"react": "^19.0.0"
|