Executes a function when it stops being invoked for n seconds. Usually used together with resize,
scroll and keyup/keydown-events to improve application's performance.
This will call the computationalHeavyFunction once BEFORE the resize-event has finished,
and thereafter will not be able to be called again until the timeout has finished
Executes a function when it stops being invoked for n seconds. Usually used together with resize, scroll and keyup/keydown-events to improve application's performance.
Example:
This will call the
computationalHeavyFunction
once if the resize-event hasn't been sent for 1000 ms.Example with immediate-flag:
This will call the
computationalHeavyFunction
once BEFORE the resize-event has finished, and thereafter will not be able to be called again until the timeout has finished