com.bumpslide.util.Throttle
Throttles function calls
This class is designed to limit the number of calls made to a function
by putting a minimum time requirement in between each call.
We often do this with setInterval, but with setInterval, we are constantly
resetting the timer. Throttling is useful for stage updates and for operations
that require loading resources to be viewed such as in a thumbnail scroller.
Usage:
var stageUpdater = new Throttle( Delegate.create( this, doUpdate), 500 );
function onResize() { // Stage.onResize handler (for example)
stageUpdater.trigger();
}
function doUpdate() {
// my expensive code goes here and will only get called twice per second *
}