防抖(debounce) 和 节流(throttling)

理解两句话:

1.debounce 的特点是当事件快速连续不断触发时,动作只会执行一次。 

2.throttling 节流的策略是,固定周期内,只执行一次动作,若有新事件触发,不执行。周期结束后,又有事件触发,开始新的周期。

参考:

https://blog.csdn.net/a_passing_traveller/article/details/89083676

https://blog.csdn.net/hupian1989/article/details/80920324?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.compare&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.compare

posted @ 2020-08-05 18:29  我将枕中记忆抹去任岁月浮光掠影  阅读(347)  评论(0编辑  收藏  举报