Startup News 4 years ago
startup #code

Throttling and Debouncing in JavaScript

Debouncing and throttling are two techniques in JavaScript to optimize the application and browser performance by controlling how many times we allow a function to be executed over time.

Imagine having a typeahead text input where you need to search for some data. Every single time you type a character into the input, an API call is triggered. This is not an efficient approach because the call should only be made when the user stops typing.

Using a debounced function for this particular situation will help us to achieve the desired behavior and will significantly increase the speed of the search.

Another good example is controlling how often a mouseover event handler should be executed. If you attach the mouseover event to a DOM element and try to walk around the mouse cursor, you’ll see that the event handler is executed tens of times per second. There are situations when you do not need that many executions and this can be easily fixed using a throttle function.


A technical article about Debounce and Throttle in JavaScript can be found here: https://codeburst.io/throttling-and-debouncing-in-javascript-b01cad5c8edf

Fil Rouge Capital Lands in Romania with €60M Fund — Taps Matei Dumitrescu as Venture Partner

Fil Rouge Capital Lands in Romania with €60M Fund — Taps Matei Dumitre...

defaultuser.png
Startup News
1 year ago
Building smarter with HiFiles AI - New features and what’s coming next

Building smarter with HiFiles AI - New features and what’s coming next

defaultuser.png
Startup News
1 year ago
AI suggestions for - What to tell a girl on a first date?

AI suggestions for - What to tell a girl on a first date?

defaultuser.png
Startup News
3 years ago
Introducing HiFiles AI: Your ultimate AI-Powered document assistant

Introducing HiFiles AI: Your ultimate AI-Powered document assistant

defaultuser.png
Startup News
1 year ago
Croatia's Fil Rouge Capital Wins "Early-stage Venture Capital Investment of the Year" Award and Celebrates Stevica Kuharski's Promotion to Partner

Croatia's Fil Rouge Capital Wins "Early-stage Venture Capital Investme...

defaultuser.png
Startup News
3 years ago