Simple Implementation of Throttle and Debounce
August 24, 2018
Throttle and Debounce
In front-end, throttle and debounce are quite important for performance enhancement. Especially useful on events like window.onresize
which will be triggered in high frequency.
I have just put a very very simple implementation underneath.
1 | function debounce(func, wait) { |
查看评论