Debounce and Throttle are techniques to control how many time we allow an event to occur. The difference between them is explained below with an example
The Debounce technique allow us to “group” multiple sequential calls in a single one.
Throttle guarantees the execution of the function regularly, at least every x milliseconds while the event is occurring.
Let us see an example
Throttle and Debounce can be useful in many situations like while the user is typing in the search box and you need to fire ajax event to populate filtered suggestions or for the drag event where you need to perform some action while user is dragging an element.
I hope this simple post has helped you understand why throttling and debouncing is used and what the the difference between them
You can see the same mails with exact same data and time-stamps on your Gmail account from a variety of devices. It is obvious that all your devices are pulling this email data from a single source provided by Google. This device and platform independence is achieved by separating the…
An employer visit to Facebook was arranged by my university (Binghamton University, NY). I was excited to see what Facebook actually do to keep the huge website running and upgrading. As I had heard and read that they have a cool and happening culture, I was curious to learn about…