Skip to content

Commit ac8f3e1

Browse files
ChadKillingswortharthurvr
authored andcommitted
Deferred: Refer to the method as a factory, not a constructor.
Closes gh-625
1 parent 2a93e01 commit ac8f3e1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

entries/jQuery.Deferred.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
</argument>
1515
</argument>
1616
</signature>
17-
<desc> A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.</desc>
17+
<desc> A factory function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.</desc>
1818
<longdesc>
19-
<p>The <code>jQuery.Deferred()</code> constructor creates a new Deferred object. The <code>new</code> operator is optional.</p>
20-
<p>The <code>jQuery.Deferred</code> method can be passed an optional function, which is called just before the constructor returns and is passed the constructed <code>deferred</code> object as both the <code>this</code> object and as the first argument to the function. The called function can attach callbacks using <a href="/deferred.then/"><code>deferred.then()</code></a>, for example.</p>
19+
<p>The <code>jQuery.Deferred()</code> factory creates a new <code>deferred</code> object.</p>
20+
<p>The <code>jQuery.Deferred</code> method can be passed an optional function, which is called just before the method returns and is passed the new <code>deferred</code> object as both the <code>this</code> object and as the first argument to the function. The called function can attach callbacks using <a href="/deferred.then/"><code>deferred.then()</code></a>, for example.</p>
2121
<p>A Deferred object starts in the <em>pending</em> state. Any callbacks added to the object with <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>, or <a href="/deferred.fail/"><code>deferred.fail()</code></a> are queued to be executed later. Calling <a href="/deferred.resolve/"><code>deferred.resolve()</code></a> or <a href="/deferred.resolveWith/"><code>deferred.resolveWith()</code></a> transitions the Deferred into the <em>resolved</em> state and immediately executes any <code>doneCallbacks</code> that are set. Calling <a href="/deferred.reject/"><code>deferred.reject()</code></a> or <a href="/deferred.rejectWith/"><code>deferred.rejectWith()</code></a> transitions the Deferred into the <em>rejected</em> state and immediately executes any <code>failCallbacks</code> that are set. Once the object has entered the resolved or rejected state, it stays in that state. Callbacks can still be added to the resolved or rejected Deferred — they will execute immediately.</p>
2222
<h4>
2323
Enhanced Callbacks with jQuery Deferred

0 commit comments

Comments
 (0)