Growing with the Web


My name is Daniel Imms and I'm a software engineer from Australia. I live in Seattle and work at Amazon on the Silk Web Browser. I use this blog as a platform to learn, revise and teach various software development topics.

This snippet is useful when applied to events that occur many times such as resize and scroll, particularly when the callback does heavy processing. It throttles the calls to the callback by only calling in to the callback if the event has not occurred again in the last 300ms. This technique is called 'debouncing'.