fn 为逻辑的函数
wait 为出发间隔时间

const debounce = (fn, wait = 1000) => { if (window.timeout) clearTimeout(window.timeout) window.timeout = setTimeout(() => { fn() }, wait) }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
  • 2021-06-15
  • 2021-10-10
猜你喜欢
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-12-26
  • 2021-11-20
相关资源
相似解决方案