@tarsis/toolkit 0.6.4 → 0.6.6
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/{gl-CF6SrQxS.js → gl-C1OpenGq.js} +1 -1
- package/dist/{gl-u7lLnVc7.cjs → gl-LtHwn-bj.cjs} +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.d.ts +15 -2
- package/dist/hooks.js +1 -1
- package/dist/{index-DUlCyGFJ.js → index-Cz74WvnK.js} +1 -1
- package/dist/{index-DMypN5i0.cjs → index-DhWWozeo.cjs} +1 -1
- package/dist/{index-DrMeiPM1.cjs → index-DvXp0wCM.cjs} +29 -29
- package/dist/{index-DDE-qC4q.js → index-JZY8IMW2.js} +29 -29
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +20 -7
- package/dist/index.js +2 -2
- package/dist/styles.css +627 -627
- package/dist/{useWindowReady-CIYJL39Z.cjs → useWindowReady-6kIdYolB.cjs} +5 -1
- package/dist/{useWindowReady-CYOtIur4.js → useWindowReady-tUs-ONyG.js} +5 -1
- package/package.json +1 -1
|
@@ -8957,6 +8957,9 @@ const useDebounce = (callback, delay, { maxWait, leading = false } = {}) => {
|
|
|
8957
8957
|
maxTimeoutMetadataRef.current = null;
|
|
8958
8958
|
}
|
|
8959
8959
|
}, []);
|
|
8960
|
+
const cancel = React.useCallback(() => {
|
|
8961
|
+
clearTimers();
|
|
8962
|
+
}, [clearTimers]);
|
|
8960
8963
|
const invokeCallback = React.useCallback(
|
|
8961
8964
|
(args) => {
|
|
8962
8965
|
clearTimers();
|
|
@@ -8967,7 +8970,7 @@ const useDebounce = (callback, delay, { maxWait, leading = false } = {}) => {
|
|
|
8967
8970
|
React.useEffect(() => {
|
|
8968
8971
|
return clearTimers;
|
|
8969
8972
|
}, [clearTimers]);
|
|
8970
|
-
|
|
8973
|
+
const debounced = React.useCallback(
|
|
8971
8974
|
(...args) => {
|
|
8972
8975
|
const isNewCycle = timeoutRef.current === null;
|
|
8973
8976
|
if (leading && isNewCycle) {
|
|
@@ -8994,6 +8997,7 @@ const useDebounce = (callback, delay, { maxWait, leading = false } = {}) => {
|
|
|
8994
8997
|
},
|
|
8995
8998
|
[delay, maxWait, leading, invokeCallback, callbackRef]
|
|
8996
8999
|
);
|
|
9000
|
+
return Object.assign(debounced, { cancel });
|
|
8997
9001
|
};
|
|
8998
9002
|
|
|
8999
9003
|
const useUniversalLayoutEffect = typeof window === "undefined" ? React.useEffect : React.useLayoutEffect;
|
|
@@ -8955,6 +8955,9 @@ const useDebounce = (callback, delay, { maxWait, leading = false } = {}) => {
|
|
|
8955
8955
|
maxTimeoutMetadataRef.current = null;
|
|
8956
8956
|
}
|
|
8957
8957
|
}, []);
|
|
8958
|
+
const cancel = useCallback(() => {
|
|
8959
|
+
clearTimers();
|
|
8960
|
+
}, [clearTimers]);
|
|
8958
8961
|
const invokeCallback = useCallback(
|
|
8959
8962
|
(args) => {
|
|
8960
8963
|
clearTimers();
|
|
@@ -8965,7 +8968,7 @@ const useDebounce = (callback, delay, { maxWait, leading = false } = {}) => {
|
|
|
8965
8968
|
useEffect(() => {
|
|
8966
8969
|
return clearTimers;
|
|
8967
8970
|
}, [clearTimers]);
|
|
8968
|
-
|
|
8971
|
+
const debounced = useCallback(
|
|
8969
8972
|
(...args) => {
|
|
8970
8973
|
const isNewCycle = timeoutRef.current === null;
|
|
8971
8974
|
if (leading && isNewCycle) {
|
|
@@ -8992,6 +8995,7 @@ const useDebounce = (callback, delay, { maxWait, leading = false } = {}) => {
|
|
|
8992
8995
|
},
|
|
8993
8996
|
[delay, maxWait, leading, invokeCallback, callbackRef]
|
|
8994
8997
|
);
|
|
8998
|
+
return Object.assign(debounced, { cancel });
|
|
8995
8999
|
};
|
|
8996
9000
|
|
|
8997
9001
|
const useUniversalLayoutEffect = typeof window === "undefined" ? React__default.useEffect : React__default.useLayoutEffect;
|