Methods
-
promise() → {Deferred}
-
Description
Returns a Promise object.
Returns
Details
-
notify( args ) → {Deferred}
-
Description
Calls the progressCallbacks on a Deferred object with the given arguments.
Parameters
Name Type Description args
Object Optional arguments that are passed to the progressCallbacks.
Returns
Details
-
fail( failCallbacks ) → {Deferred}
-
Description
Adds handlers to be called when the Deferred object is rejected.
This method accepts one or more arguments, all of which can be either a single function or an array of functions. When the Deferred is rejected, the failCallbacks are called.Parameters
Name Type Description failCallbacks
function | Array.<function()> Returns
Details
-
state() → {string}
-
Description
Determines the current state of a Deferred object.
Returns
Details
-
done( doneCallbacks ) → {Deferred}
-
Description
Adds handlers to be called when the Deferred object is resolved.
This method accepts one or more arguments, all of which can be either a single function or an array of functions. When the Deferred is resolved, the doneCallbacks are called. Callbacks are executed in the order they were added.Parameters
Name Type Description doneCallbacks
function | Array.<function()> Returns
Details
-
progress( progressCallbacks ) → {Deferred}
-
Description
Adds handlers to be called when the Deferred object generates progress notifications.
This method accepts one or more arguments, all of which can be either a single function or an array of functions. When Deferred.notify() is called, the function or functions are called.Parameters
Name Type Description progressCallbacks
function | Array.<function()> Returns
Details
-
always( alwaysCallbacks ) → {Deferred}
-
Description
Adds handlers to be called when the Deferred object is either resolved or rejected.
The deferred.always() method receives the arguments that were used to .resolve() or .reject() the Deferred object, which are often very different.Parameters
Name Type Description alwaysCallbacks
function | Array.<function()> A function, or array of functions, that is called when the Deferred is resolved or rejected.
Returns
Details
-
then( doneFilter [, failFilter [, progressFilter ] ] ) → {Deferred}
-
Description
Adds handlers to be called when the Deferred object is resolved, rejected, or in progress.
Parameters
Name Type Attributes Description doneFilter
function A function that is called when the Deferred is resolved.
failFilter
function <optional> An optional function that is called when the Deferred is rejected.
progressFilter
function <optional> An optional function that is called when progress notifications are sent.
Returns
Details
-
resolve( args ) → {Deferred}
-
Description
Resolve a Deferred object and call any doneCallbacks with the given args.
Parameters
Name Type Description args
object Returns
Details
-
reject( args ) → {Deferred}
-
Description
Rejects a Deferred object and calls any failCallbacks with the given arguments.
Parameters
Name Type Description args
Object Optional arguments that are passed to the failCallbacks.
Returns
Details