@timardex/cluemart-shared 2.0.0 → 2.0.2
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/{chunk-JJQL6LZE.mjs → chunk-D45RNLV2.mjs} +1 -1
- package/dist/chunk-D45RNLV2.mjs.map +1 -0
- package/dist/{chunk-XPUYQ7GB.mjs → chunk-GRP7XQNB.mjs} +11 -7
- package/dist/{chunk-XPUYQ7GB.mjs.map → chunk-GRP7XQNB.mjs.map} +1 -1
- package/dist/{chunk-L3SNS6OJ.mjs → chunk-XED54CPG.mjs} +2 -2
- package/dist/formFields/index.mjs +2 -2
- package/dist/graphql/index.cjs +9 -5
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.mjs +1 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +3 -3
- package/dist/index.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{resourceActivities-BvejCLh9.d.mts → resourceActivities-BJAI4jf-.d.mts} +1 -1
- package/dist/{resourceActivities-Smsl03Je.d.ts → resourceActivities-BW648M1v.d.ts} +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-JJQL6LZE.mjs.map +0 -1
- /package/dist/{chunk-L3SNS6OJ.mjs.map → chunk-XED54CPG.mjs.map} +0 -0
package/dist/hooks/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
SCHOOL_MIN_STUDENT_COUNT,
|
|
8
8
|
isValidIrdNumber,
|
|
9
9
|
normalizeUrl
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-XED54CPG.mjs";
|
|
11
11
|
import {
|
|
12
12
|
dateFormat,
|
|
13
13
|
timeFormat
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
EnumAffiliateParticipantType,
|
|
21
21
|
EnumPostContentType,
|
|
22
22
|
EnumPostType
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-D45RNLV2.mjs";
|
|
24
24
|
import "../chunk-RAYUJODN.mjs";
|
|
25
25
|
import "../chunk-DQ7ZHIXW.mjs";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-GRP7XQNB.mjs";
|
|
27
27
|
import "../chunk-OUWKLNHZ.mjs";
|
|
28
28
|
import "../chunk-7DQBUZXY.mjs";
|
|
29
29
|
import {
|
package/dist/index.cjs
CHANGED
|
@@ -9028,6 +9028,10 @@ function usePaginatedList({
|
|
|
9028
9028
|
skip,
|
|
9029
9029
|
variables: { ...variables, options: { limit: pageSize + 1, offset } }
|
|
9030
9030
|
});
|
|
9031
|
+
const refetchRef = (0, import_react.useRef)(refetch);
|
|
9032
|
+
refetchRef.current = refetch;
|
|
9033
|
+
const variablesRef = (0, import_react.useRef)(variables);
|
|
9034
|
+
variablesRef.current = variables;
|
|
9031
9035
|
const rawPage = getItems(data);
|
|
9032
9036
|
const page = rawPage.length > pageSize ? rawPage.slice(0, pageSize) : rawPage;
|
|
9033
9037
|
const hasMorePage = rawPage.length > pageSize;
|
|
@@ -9052,7 +9056,7 @@ function usePaginatedList({
|
|
|
9052
9056
|
return;
|
|
9053
9057
|
}
|
|
9054
9058
|
if (error) {
|
|
9055
|
-
void
|
|
9059
|
+
void refetchRef.current();
|
|
9056
9060
|
return;
|
|
9057
9061
|
}
|
|
9058
9062
|
if (!hasSettled) {
|
|
@@ -9062,7 +9066,7 @@ function usePaginatedList({
|
|
|
9062
9066
|
return;
|
|
9063
9067
|
}
|
|
9064
9068
|
setOffset(offset + pageSize);
|
|
9065
|
-
}, [loading, skip, error, hasSettled, hasMore, offset, pageSize
|
|
9069
|
+
}, [loading, skip, error, hasSettled, hasMore, offset, pageSize]);
|
|
9066
9070
|
const refresh = (0, import_react.useCallback)(() => {
|
|
9067
9071
|
setItems([]);
|
|
9068
9072
|
setHasMore(!skip);
|
|
@@ -9071,11 +9075,11 @@ function usePaginatedList({
|
|
|
9071
9075
|
if (skip) {
|
|
9072
9076
|
return Promise.resolve();
|
|
9073
9077
|
}
|
|
9074
|
-
return
|
|
9075
|
-
...
|
|
9078
|
+
return refetchRef.current({
|
|
9079
|
+
...variablesRef.current,
|
|
9076
9080
|
options: { limit: pageSize + 1, offset: 0 }
|
|
9077
9081
|
});
|
|
9078
|
-
}, [
|
|
9082
|
+
}, [pageSize, skip]);
|
|
9079
9083
|
return {
|
|
9080
9084
|
error,
|
|
9081
9085
|
hasMore,
|