flat: 暂存, 推送服务
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user