// 节流
export const throttle = (fn, time) => {let timer = nullreturn (...args) => {if (!timer) {timer = setTimeout(() => {timer = nullfn.apply(this, args)}, time)}}
}// 防抖
export const debounce = (fn, time) => {let timer = nullreturn (...args) => {clearTimeout(timer)timer = setTimeout(() => {fn.apply(this, args)}, time)}
}