防抖与节流

2019-07-15  本文已影响0人  EmilWong

function debounce (handle, delay) {

  let timer = null

  return function () {

      let _this = this, args = arguments;

      clearTimeout(timer)

      timer = setTimeout(function () {

          handle.apply(_this, args)

      }, delay)

  }

}

上一篇 下一篇

猜你喜欢

热点阅读