flat: 暂存, 推送服务

This commit is contained in:
Apcallover
2024-03-19 17:23:29 +08:00
parent 261de5fdcf
commit 5c9ea95fb8
7 changed files with 325 additions and 58 deletions

View File

@@ -396,3 +396,14 @@ export const nameDesensitization = (name) => {
str = str.substring(0,1) + new Array(str.length).join('*')
return str;
}
export function debounce(fn, delay) {
let timer = null
return function() {
const context = this
const args = arguments
clearTimeout(timer)
timer = setTimeout(function() {
fn.apply(context, args)
}, delay)
}
}