Skip to content

Commit f838424

Browse files
committed
jQuery.Deferred(): Change "Deferred-compatible" to "Promise-compatible". Thanks @AurelioDeRosa. Fixes #567.
1 parent 54f299f commit f838424

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entries/jQuery.Deferred.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<p>In JavaScript it is common to invoke functions that optionally accept callbacks that are called within that function. For example, in versions prior to jQuery 1.5, asynchronous processes such as <code>jQuery.ajax()</code> accept callbacks to be invoked some time in the near-future upon success, error, and completion of the ajax request.</p>
2626
<p><code>jQuery.Deferred()</code> introduces several enhancements to the way callbacks are managed and invoked. In particular, <code>jQuery.Deferred()</code> provides flexible ways to provide multiple callbacks, and these callbacks can be invoked regardless of whether the original callback dispatch has already occurred. jQuery Deferred is based on the <a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a> design.</p>
2727
<p>One model for understanding Deferred is to think of it as a chain-aware function wrapper. The <a href="/deferred.then/"><code>deferred.then()</code></a>, <a href="/deferred.always/"><code>deferred.always()</code></a>, <a href="/deferred.done/"><code>deferred.done()</code></a>, and <a href="/deferred.fail/"><code>deferred.fail()</code></a> methods specify the functions to be called and the <a href="/deferred.resolve/"><code>deferred.resolve(args)</code></a> or <a href="/deferred.reject/"><code>deferred.reject(args)</code></a> methods "call" the functions with the arguments you supply. Once the Deferred has been resolved or rejected it stays in that state; a second call to <code>deferred.resolve()</code>, for example, is ignored. If more functions are added by <code>deferred.then()</code>, for example, after the Deferred is resolved, they are called immediately with the arguments previously provided.</p>
28-
<p>In most cases where a jQuery API call returns a Deferred or Deferred-compatible object, such as <a href="/jQuery.ajax/"><code>jQuery.ajax()</code></a> or <a href="/jQuery.when/"><code>jQuery.when()</code></a>, you will only want to use the <a href="/deferred.then/"><code>deferred.then()</code></a>, <a href="/deferred.done/"><code>deferred.done()</code></a>, and <a href="/deferred.fail/"><code>deferred.fail()</code></a> methods to add callbacks to the Deferred's queues. The internals of the API call or code that created the Deferred will invoke <a href="/deferred.resolve/"><code>deferred.resolve()</code></a> or <a href="/deferred.reject/"><code>deferred.reject()</code></a> on the deferred at some point, causing the appropriate callbacks to run.</p>
28+
<p>In most cases where a jQuery API call returns a Deferred or Promise-compatible object, such as <a href="/jQuery.ajax/"><code>jQuery.ajax()</code></a> or <a href="/jQuery.when/"><code>jQuery.when()</code></a>, you will only want to use the <a href="/deferred.then/"><code>deferred.then()</code></a>, <a href="/deferred.done/"><code>deferred.done()</code></a>, and <a href="/deferred.fail/"><code>deferred.fail()</code></a> methods to add callbacks to the Deferred's queues. The internals of the API call or code that created the Deferred will invoke <a href="/deferred.resolve/"><code>deferred.resolve()</code></a> or <a href="/deferred.reject/"><code>deferred.reject()</code></a> on the deferred at some point, causing the appropriate callbacks to run.</p>
2929
</longdesc>
3030
<category slug="deferred-object"/>
3131
<category slug="version/1.5"/>

0 commit comments

Comments
 (0)