@timardex/cluemart-shared 2.0.0 → 2.0.1

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.
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  PROMO_CODE_PREFIX,
12
12
  gameScreenIdentifierList
13
- } from "./chunk-JJQL6LZE.mjs";
13
+ } from "./chunk-D45RNLV2.mjs";
14
14
  import {
15
15
  isTransientNetworkError
16
16
  } from "./chunk-RAYUJODN.mjs";
@@ -1780,4 +1780,4 @@ export {
1780
1780
  toUserFacingErrorMessage,
1781
1781
  getErrorMessage
1782
1782
  };
1783
- //# sourceMappingURL=chunk-L3SNS6OJ.mjs.map
1783
+ //# sourceMappingURL=chunk-XED54CPG.mjs.map
@@ -46,9 +46,9 @@ import {
46
46
  import {
47
47
  availableCategories,
48
48
  categoryColors
49
- } from "../chunk-L3SNS6OJ.mjs";
49
+ } from "../chunk-XED54CPG.mjs";
50
50
  import "../chunk-YRO6KEZG.mjs";
51
- import "../chunk-JJQL6LZE.mjs";
51
+ import "../chunk-D45RNLV2.mjs";
52
52
  import "../chunk-RAYUJODN.mjs";
53
53
  import "../chunk-DQ7ZHIXW.mjs";
54
54
  import "../chunk-7DQBUZXY.mjs";
@@ -5327,6 +5327,10 @@ function usePaginatedList({
5327
5327
  skip,
5328
5328
  variables: { ...variables, options: { limit: pageSize + 1, offset } }
5329
5329
  });
5330
+ const refetchRef = (0, import_react.useRef)(refetch);
5331
+ refetchRef.current = refetch;
5332
+ const variablesRef = (0, import_react.useRef)(variables);
5333
+ variablesRef.current = variables;
5330
5334
  const rawPage = getItems(data);
5331
5335
  const page = rawPage.length > pageSize ? rawPage.slice(0, pageSize) : rawPage;
5332
5336
  const hasMorePage = rawPage.length > pageSize;
@@ -5351,7 +5355,7 @@ function usePaginatedList({
5351
5355
  return;
5352
5356
  }
5353
5357
  if (error) {
5354
- void refetch();
5358
+ void refetchRef.current();
5355
5359
  return;
5356
5360
  }
5357
5361
  if (!hasSettled) {
@@ -5361,7 +5365,7 @@ function usePaginatedList({
5361
5365
  return;
5362
5366
  }
5363
5367
  setOffset(offset + pageSize);
5364
- }, [loading, skip, error, hasSettled, hasMore, offset, pageSize, refetch]);
5368
+ }, [loading, skip, error, hasSettled, hasMore, offset, pageSize]);
5365
5369
  const refresh = (0, import_react.useCallback)(() => {
5366
5370
  setItems([]);
5367
5371
  setHasMore(!skip);
@@ -5370,11 +5374,11 @@ function usePaginatedList({
5370
5374
  if (skip) {
5371
5375
  return Promise.resolve();
5372
5376
  }
5373
- return refetch({
5374
- ...variables,
5377
+ return refetchRef.current({
5378
+ ...variablesRef.current,
5375
5379
  options: { limit: pageSize + 1, offset: 0 }
5376
5380
  });
5377
- }, [refetch, variables, pageSize, skip]);
5381
+ }, [pageSize, skip]);
5378
5382
  return {
5379
5383
  error,
5380
5384
  hasMore,