can.when
Call a callback when a Deferred resolves.
can.when(deferred)
Parameters
-
deferred
{Deferred | Object}
The Deferred, AJAX, or normal Objects to call the callback on.
Returns
{Deferred}
deferred if deferred is a Deferred, otherwise a Deferred that resolves to deferred.
can.when(deferred)
provides the ability to execute callback function(s) typically based on a Deferred or AJAX object.This is a wrapper API for the underlying library being used. If you're using jQuery, this is a wrapper API for jQuery.when;
You can also use this to wait for the results of multiple deferreds.
You can also use this for regular JavaScript objects.