DEV Community

loading...

Discussion on: Debouncing in Javascript.

Collapse
larsonnn profile image
Lars Feldeisen • Edited

My customers would go crazy if they wait. Debouncing should be limited to a few miliseconds. The user needs the answer right away. Search in google and wait for the results. You would go crazy too. If you realy have problems with your traffic try to cache API results on a server like redis. Have multiply API endpoints in different locations.

Your post is good!

Collapse
abhishekjain35 profile image
Abhishek Jain Author

Hey Lars, The 1 second delay is just for example. I just wanted the reader to visualise how denouncing works. But in real world the delay is always below 400ms. 🙂🙂

Collapse
devdaksh profile image
Daksh Kulshrestha

a simple hack: set a good amount of delay and when users get mad, wait for a day or so and remove the delay and tell them you worked hours to fix the bug.

Collapse
larsonnn profile image
Lars Feldeisen

And repeat next week.

Collapse
abhishekjain35 profile image
Abhishek Jain Author

Modern problems require modern solutions 😆 😆

Collapse
bantya profile image
Rahul Thakare

Best tip ever. 💯