Lodash.throttle

Marcos Neves
vuejs-tips
Published in
1 min readMar 30, 2017

Debounce twin brother. Tip #16

Like twin brothers, Lodash's functions throttle and debounce my look alike, but they behave differently.

While debounce executes once after the elapsed milliseconds, throttle executes every elapsed milliseconds.

But one example makes it clear:

move the mouse over and stop moving

What're you using throttle for?

--

--

Marcos Neves
vuejs-tips

Ancient Brazilian web developer, from php, through Rails to Javascript, Vue.js enthusiast to React.