Skip to content

Commit 2530f20

Browse files
committed
Deferred methods: Update arg types for progress, reject, resolve
cf. http://forum.jquery.com/topic/confusion-of-anything-vs-object-in-documentation
1 parent becece1 commit 2530f20

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

entries/deferred.progress.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
<title>deferred.progress()</title>
44
<signature>
55
<added>1.7</added>
6-
<argument name="progressCallbacks" type="Function">
6+
<argument name="progressCallbacks">
7+
<type name="Function"/>
8+
<type name="Array"/>
79
<desc>
8-
A function, or array of functions, that is called when the Deferred generates progress notifications.
10+
A function, or array of functions, to be called when the Deferred generates progress notifications.
911
</desc>
1012
</argument>
1113
</signature>
1214
<desc> Add handlers to be called when the Deferred object generates progress notifications.</desc>
1315
<longdesc>
14-
<p>The argument can be either a single function or an array of functions. When the Deferred generates progress notifications by calling <code>notify</code> or <code>notifyWith</code>, the <code>progressCallbacks</code> are called. Since <code>deferred.progress()</code> returns the Deferred object, other methods of the Deferred object can be chained to this one. When the Deferred is resolved or rejected, progress callbacks will no longer be called, with the exception that any <code>progressCallbacks</code> added after the Deferred enters the resolved or rejected state are executed immediately when they are added, using the arguments that were passed to the <code>.notify()</code> or <code>notifyWith()</code> call. For more information, see the documentation <a href="/jquery.deferred/">jQuery.Deferred()</a>.</p>
16+
<p>The argument can be either a single function or an array of functions. When the Deferred generates progress notifications by calling <code>notify</code> or <code>notifyWith</code>, the <code>progressCallbacks</code> are called. Since <code>deferred.progress()</code> returns the Deferred object, other methods of the Deferred object can be chained to this one. When the Deferred is resolved or rejected, progress callbacks will no longer be called, with the exception that any <code>progressCallbacks</code> added after the Deferred enters the resolved or rejected state are executed immediately when they are added, using the arguments that were passed to the <code>.notify()</code> or <code>notifyWith()</code> call. For more information, see the documentation for <a href="/jQuery.Deferred/">jQuery.Deferred()</a>.</p>
1517
</longdesc>
1618
<category slug="deferred-object"/>
1719
<category slug="version/1.7"/>

entries/deferred.reject.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<title>deferred.reject()</title>
44
<signature>
55
<added>1.5</added>
6-
<argument name="args" type="Object">
6+
<argument name="args" type="Anything" optional="true">
77
<desc>
88
Optional arguments that are passed to the failCallbacks.
99
</desc>
@@ -12,7 +12,7 @@
1212
<desc> Reject a Deferred object and call any failCallbacks with the given <code>args</code>. </desc>
1313
<longdesc>
1414
<p>Normally, only the creator of a Deferred should call this method; you can prevent other code from changing the Deferred's state by returning a restricted Promise object through <a href="http://api.jquery.com/deferred.promise/"><code>deferred.promise()</code></a>.</p>
15-
<p>When the Deferred is rejected, any failCallbacks added by <a href="http://api.jquery.com/deferred.then/"><code>deferred.then</code></a> or <a href="http://api.jquery.com/deferred.fail/"><code>deferred.fail</code></a> are called. Callbacks are executed in the order they were added. Each callback is passed the <code>args</code> from the <code>deferred.reject()</code> call. Any failCallbacks added after the Deferred enters the rejected state are executed immediately when they are added, using the arguments that were passed to the <code>.reject()</code> call. For more information, see the documentation for <a href="http://api.jquery.com/category/deferred-object/">Deferred object</a>.</p>
15+
<p>When the Deferred is rejected, any failCallbacks added by <a href="http://api.jquery.com/deferred.then/"><code>deferred.then()</code></a> or <a href="http://api.jquery.com/deferred.fail/"><code>deferred.fail()</code></a> are called. Callbacks are executed in the order they were added. Each callback is passed the <code>args</code> from the <code>deferred.reject()</code> call. Any failCallbacks added after the Deferred enters the rejected state are executed immediately when they are added, using the arguments that were passed to the <code>deferred.reject()</code> call. For more information, see the documentation for <a href="/jQuery.Deferred/">jQuery.Deferred()</a>.</p>
1616
</longdesc>
1717
<category slug="deferred-object"/>
1818
<category slug="version/1.5"/>

entries/deferred.resolve.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<title>deferred.resolve()</title>
44
<signature>
55
<added>1.5</added>
6-
<argument name="args" type="Object">
6+
<argument name="args" type="Anything" optional="true">
77
<desc>
88
Optional arguments that are passed to the doneCallbacks.
99
</desc>
1010
</argument>
1111
</signature>
1212
<desc> Resolve a Deferred object and call any doneCallbacks with the given <code>args</code>. </desc>
1313
<longdesc>
14-
<p>When the Deferred is resolved, any doneCallbacks added by <a href="/deferred.then/"><code>deferred.then</code></a> or <a href="/deferred.done/"><code>deferred.done</code></a> are called. Callbacks are executed in the order they were added. Each callback is passed the <code>args</code> from the <code>.resolve()</code>. Any doneCallbacks added after the Deferred enters the resolved state are executed immediately when they are added, using the arguments that were passed to the <code>.resolve()</code> call. For more information, see the documentation for <a href="/category/deferred-object/">Deferred object</a>.</p>
14+
<p>When the Deferred is resolved, any doneCallbacks added by <a href="/deferred.then/"><code>deferred.then()</code></a> or <a href="/deferred.done/"><code>deferred.done()</code></a> are called. Callbacks are executed in the order they were added. Each callback is passed the <code>args</code> from the <code>deferred.resolve()</code>. Any doneCallbacks added after the Deferred enters the resolved state are executed immediately when they are added, using the arguments that were passed to the <code>deferred.resolve()</code> call. For more information, see the documentation for <a href="/jQuery.Deferred/">jQuery.Deferred()</a>.</p>
1515
</longdesc>
1616
<category slug="deferred-object"/>
1717
<category slug="version/1.5"/>

0 commit comments

Comments
 (0)