DEV Community

Discussion on: Better event throttle

Collapse
 
efpage profile image
Eckehard

reset the delay with every new function call

This is done often, but was exact the reason to think about a different approach. If nothing happens until the user stops typing, this will be a bad experience. Think of a text input device, where you do not see any input until you stop typing...

Using a shorter initial delay makes your app feel responsive, but the repetition might be slower. This is exactly what I wanted to achieve.