next-recomponents 1.5.9 → 1.5.93

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.js CHANGED
@@ -32292,7 +32292,7 @@ function useResources({
32292
32292
  const token = useToken();
32293
32293
  const [info, setInfo] = (0, import_react28.useState)({});
32294
32294
  const result = (0, import_react28.useMemo)(() => {
32295
- return Object.keys(endpoints).reduce((acc, key) => {
32295
+ return Object.keys(endpoints).reduce((acc, key) => __async(null, null, function* () {
32296
32296
  var _c, _d, _e, _f, _g, _h, _i;
32297
32297
  const endpoint = endpoints[key];
32298
32298
  const showFunc = (_a) => __async(null, null, function* () {
@@ -32543,7 +32543,7 @@ function useResources({
32543
32543
  selectedItem: ((_i = info[key]) == null ? void 0 : _i.selectedItem) || {}
32544
32544
  });
32545
32545
  return acc;
32546
- }, {});
32546
+ }), {});
32547
32547
  }, [info, token, endpoints]);
32548
32548
  function loadAll() {
32549
32549
  return __async(this, null, function* () {
@@ -32561,7 +32561,7 @@ function useResources({
32561
32561
  }
32562
32562
  (0, import_react28.useEffect)(() => {
32563
32563
  loadAll();
32564
- }, [result]);
32564
+ }, []);
32565
32565
  return result;
32566
32566
  }
32567
32567
 
package/dist/index.mjs CHANGED
@@ -32282,7 +32282,7 @@ function useResources({
32282
32282
  const token = useToken();
32283
32283
  const [info, setInfo] = useState8({});
32284
32284
  const result = useMemo9(() => {
32285
- return Object.keys(endpoints).reduce((acc, key) => {
32285
+ return Object.keys(endpoints).reduce((acc, key) => __async(null, null, function* () {
32286
32286
  var _c, _d, _e, _f, _g, _h, _i;
32287
32287
  const endpoint = endpoints[key];
32288
32288
  const showFunc = (_a) => __async(null, null, function* () {
@@ -32533,7 +32533,7 @@ function useResources({
32533
32533
  selectedItem: ((_i = info[key]) == null ? void 0 : _i.selectedItem) || {}
32534
32534
  });
32535
32535
  return acc;
32536
- }, {});
32536
+ }), {});
32537
32537
  }, [info, token, endpoints]);
32538
32538
  function loadAll() {
32539
32539
  return __async(this, null, function* () {
@@ -32551,7 +32551,7 @@ function useResources({
32551
32551
  }
32552
32552
  useEffect8(() => {
32553
32553
  loadAll();
32554
- }, [result]);
32554
+ }, []);
32555
32555
  return result;
32556
32556
  }
32557
32557
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "1.5.9",
3
+ "version": "1.5.93",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -280,7 +280,7 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
280
280
  // }, [info, token, endpoints]);
281
281
 
282
282
  const result = useMemo(() => {
283
- return Object.keys(endpoints).reduce((acc: any, key) => {
283
+ return Object.keys(endpoints).reduce(async (acc: any, key) => {
284
284
  const endpoint = endpoints[key];
285
285
  const showFunc = async ({
286
286
  limit = 10,
@@ -562,6 +562,6 @@ export default function useResources<T extends Record<string, ItemsRecord>>({
562
562
  }
563
563
  useEffect(() => {
564
564
  loadAll();
565
- }, [result]);
565
+ }, []);
566
566
  return result;
567
567
  }