@sheinx/hooks 3.2.6-beta.1 → 3.2.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;
|
1
|
+
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;kBAqBT,MAAM,SAAS,MAAM;;;;;;;CAiC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
@@ -39,6 +39,9 @@ var usePagination = function usePagination(props) {
|
|
39
39
|
(0, _react.useEffect)(function () {
|
40
40
|
if (pageSizeProp !== pageSize) setPageSize(pageSizeProp);
|
41
41
|
}, [pageSizeProp]);
|
42
|
+
(0, _react.useEffect)(function () {
|
43
|
+
if (currentProp !== undefined && currentProp !== current) setCurrent(currentProp);
|
44
|
+
}, [currentProp]);
|
42
45
|
var handleChange = (0, _usePersistFn.usePersistFn)(function (c, size) {
|
43
46
|
if (c === current && size === undefined) return;
|
44
47
|
setCurrent(c);
|
@@ -58,7 +61,7 @@ var usePagination = function usePagination(props) {
|
|
58
61
|
return _objectSpread({}, mergedEventHandlers);
|
59
62
|
};
|
60
63
|
return {
|
61
|
-
current:
|
64
|
+
current: current,
|
62
65
|
pageSize: pageSize,
|
63
66
|
total: total,
|
64
67
|
onChange: handleChange,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;
|
1
|
+
{"version":3,"file":"use-pagination.d.ts","sourceRoot":"","sources":["use-pagination.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,aAAa,UAAW,mBAAmB;;;;kBAqBT,MAAM,SAAS,MAAM;;;;;;;CAiC5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
@@ -33,6 +33,9 @@ var usePagination = function usePagination(props) {
|
|
33
33
|
useEffect(function () {
|
34
34
|
if (pageSizeProp !== pageSize) setPageSize(pageSizeProp);
|
35
35
|
}, [pageSizeProp]);
|
36
|
+
useEffect(function () {
|
37
|
+
if (currentProp !== undefined && currentProp !== current) setCurrent(currentProp);
|
38
|
+
}, [currentProp]);
|
36
39
|
var handleChange = usePersistFn(function (c, size) {
|
37
40
|
if (c === current && size === undefined) return;
|
38
41
|
setCurrent(c);
|
@@ -52,7 +55,7 @@ var usePagination = function usePagination(props) {
|
|
52
55
|
return _objectSpread({}, mergedEventHandlers);
|
53
56
|
};
|
54
57
|
return {
|
55
|
-
current:
|
58
|
+
current: current,
|
56
59
|
pageSize: pageSize,
|
57
60
|
total: total,
|
58
61
|
onChange: handleChange,
|