The goog.async Namespace

The goog.async.AnimationDelay Class

A delayed callback that pegs to the next animation frame instead of a user configurable timeout. By design, this should have the same interface as goog.async.Delay. Uses requestAnimationFrame and friends when available, but falls back to a timeout of goog.async.AnimationDelay.TIMEOUT. For more on requestAnimationFrame and how you can use it to create smoother animations, see: … more

The goog.async.ConditionalDelay Class

A ConditionalDelay object invokes the associated function after a specified interval delay and checks its return value. If the function returns {@code true} the conditional delay is cancelled and {@see #onSuccess} is called. Otherwise this object keeps to invoke the deferred function until either it returns {@code true} or the timeout is exceeded. In the latter case the {@see #onFailure} method will be called. The interval duration and timeout can be specified each time the delay is started. Calling start on an active delay will reset the timer. … more

The goog.async.Deferred Class

Represents the results of an asynchronous operation. A Deferred object starts with no result, and then gets a result at some point in the future. … more

The goog.async.DeferredList Class

Constructs an object that waits on the results of multiple asynchronous operations and marshals the results. It is itself a Deferred, and sends results to its registered callback chain. Each instance is single use and may only fire once. Unless overridden by one of the options below, the DeferredList will wait for a result from every input Deferred. The results are stored in a list of two-element arrays as [success, result], where success is whether that result was from a callback or errback. Once all results are available, the DeferredList's callback chain is invoked with the full result list. … more

The goog.async.Delay Class

A Delay object invokes the associated function after a specified delay. The interval duration can be specified once in the constructor, or can be defined each time the delay is started. Calling start on an active delay will reset the timer. … more

The goog.async.Throttle Class

Throttle will perform an action that is passed in no more than once per interval (specified in milliseconds). If it gets multiple signals to perform the action while it is waiting, it will only perform the action once at the end of the interval. … more