防抖函数

`

export cosnt _debounce = (fn, defaultTime) => {
    let timer = defaultTime || 200
    let timerFn
    return function () {
       let _that = this
       if (timerFn) {
        clearTimeout(callBack)
       } else {
         timerFn = setTimeout(() => {
            callBack = null
            fn.apply(_that, args)
         }, timer)
       }
    }
}

`


lgsn
390 声望5 粉丝