@zag-js/utils 1.21.5 → 1.21.7
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/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -173,7 +173,7 @@ var tryCatch = (fn, fallback) => {
|
|
|
173
173
|
function throttle(fn, wait = 0) {
|
|
174
174
|
let lastCall = 0;
|
|
175
175
|
let timeout = null;
|
|
176
|
-
return (...args) => {
|
|
176
|
+
return ((...args) => {
|
|
177
177
|
const now = Date.now();
|
|
178
178
|
const timeSinceLastCall = now - lastCall;
|
|
179
179
|
if (timeSinceLastCall >= wait) {
|
|
@@ -190,11 +190,11 @@ function throttle(fn, wait = 0) {
|
|
|
190
190
|
timeout = null;
|
|
191
191
|
}, wait - timeSinceLastCall);
|
|
192
192
|
}
|
|
193
|
-
};
|
|
193
|
+
});
|
|
194
194
|
}
|
|
195
195
|
function debounce(fn, wait = 0) {
|
|
196
196
|
let timeout = null;
|
|
197
|
-
return (...args) => {
|
|
197
|
+
return ((...args) => {
|
|
198
198
|
if (timeout) {
|
|
199
199
|
clearTimeout(timeout);
|
|
200
200
|
timeout = null;
|
|
@@ -202,7 +202,7 @@ function debounce(fn, wait = 0) {
|
|
|
202
202
|
timeout = setTimeout(() => {
|
|
203
203
|
fn(...args);
|
|
204
204
|
}, wait);
|
|
205
|
-
};
|
|
205
|
+
});
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
// src/number.ts
|
package/dist/index.mjs
CHANGED
|
@@ -171,7 +171,7 @@ var tryCatch = (fn, fallback) => {
|
|
|
171
171
|
function throttle(fn, wait = 0) {
|
|
172
172
|
let lastCall = 0;
|
|
173
173
|
let timeout = null;
|
|
174
|
-
return (...args) => {
|
|
174
|
+
return ((...args) => {
|
|
175
175
|
const now = Date.now();
|
|
176
176
|
const timeSinceLastCall = now - lastCall;
|
|
177
177
|
if (timeSinceLastCall >= wait) {
|
|
@@ -188,11 +188,11 @@ function throttle(fn, wait = 0) {
|
|
|
188
188
|
timeout = null;
|
|
189
189
|
}, wait - timeSinceLastCall);
|
|
190
190
|
}
|
|
191
|
-
};
|
|
191
|
+
});
|
|
192
192
|
}
|
|
193
193
|
function debounce(fn, wait = 0) {
|
|
194
194
|
let timeout = null;
|
|
195
|
-
return (...args) => {
|
|
195
|
+
return ((...args) => {
|
|
196
196
|
if (timeout) {
|
|
197
197
|
clearTimeout(timeout);
|
|
198
198
|
timeout = null;
|
|
@@ -200,7 +200,7 @@ function debounce(fn, wait = 0) {
|
|
|
200
200
|
timeout = setTimeout(() => {
|
|
201
201
|
fn(...args);
|
|
202
202
|
}, wait);
|
|
203
|
-
};
|
|
203
|
+
});
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
// src/number.ts
|