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