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.You can also use this for regular JavaScript objects.