已支付订单列表:where.payStatus = 1;
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
let timeout = null;
|
||||
function debounce(func, wait = 500, immediate = false) {
|
||||
if (timeout !== null) clearTimeout(timeout);
|
||||
if (immediate) {
|
||||
const callNow = !timeout;
|
||||
timeout = setTimeout(() => {
|
||||
timeout = null;
|
||||
}, wait);
|
||||
if (callNow) typeof func === "function" && func();
|
||||
} else {
|
||||
timeout = setTimeout(() => {
|
||||
typeof func === "function" && func();
|
||||
}, wait);
|
||||
}
|
||||
}
|
||||
exports.debounce = debounce;
|
||||
Reference in New Issue
Block a user