1 function debounce(handle, time) { 2 let timer = null; 3 return function () { 4 if (timer) { 5 clearTimeout(timer); 6 timer = null; 7 } 8 timer = setTimeout(() => { 9 handle(); 10 }, time); 11 }; 12 }
Copyright © 2009-2022 www.wtcwzsj.com 青羊区广皓图文设计工作室(个体工商户) 版权所有 蜀ICP备19037934号