zzz-pc-view 0.0.93 → 0.0.94
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/package.json
CHANGED
package/src/index.es.js
CHANGED
|
@@ -1911,8 +1911,21 @@ const useHttpRequestInterval = (request, ms) => {
|
|
|
1911
1911
|
abort
|
|
1912
1912
|
};
|
|
1913
1913
|
};
|
|
1914
|
+
const useDebounce = (callback, wait = 300) => {
|
|
1915
|
+
let timeout;
|
|
1916
|
+
return (...args) => {
|
|
1917
|
+
if (timeout !== void 0) {
|
|
1918
|
+
clearTimeout(timeout);
|
|
1919
|
+
}
|
|
1920
|
+
timeout = setTimeout(() => {
|
|
1921
|
+
timeout = void 0;
|
|
1922
|
+
callback(...args);
|
|
1923
|
+
}, wait);
|
|
1924
|
+
};
|
|
1925
|
+
};
|
|
1914
1926
|
const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1915
1927
|
__proto__: null,
|
|
1928
|
+
useDebounce,
|
|
1916
1929
|
useHttpRequestInterval,
|
|
1917
1930
|
useInterval
|
|
1918
1931
|
}, Symbol.toStringTag, { value: "Module" }));
|