no-title
debounce 防抖
简单来说,就是放抖动。
当持续触发事件时,
debounce
会合并事件且不会去触发事件,当一定时间内没有触发再这个事件时,才真正去触发事件。1debounce(fn, 1000); //1秒内没有触发这个事件才执行
debounce 防抖
简单来说,就是放抖动。
当持续触发事件时,debounce
会合并事件且不会去触发事件,当一定时间内没有触发再这个事件时,才真正去触发事件。
|
|
Promise
是异步编程的一种解决方案,比传统的解决方案(回调函数和事件)更合理更强大,能优雅解决回调地狱难题。
所谓Promise
,简单说就是一个容器,里面保存着某个未来才会结束的事件的结果。
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.