标签:timer null deb time bsp return clear bounce rgs
防抖( debounce )
debounce(func,delay){ let timer = null; return function(...args){ if(timer) clearTimeout(timer) timer = setTimeout( () => { func.apply(this,args) },delay) } }
标签:timer null deb time bsp return clear bounce rgs
原文地址:https://www.cnblogs.com/gmts/p/12865928.html