1 line
1.5 KiB
JSON
1 line
1.5 KiB
JSON
{"name":"deferred.rejectWith","type":"method","title":"deferred.rejectWith()","deprecated":null,"removed":null,"desc":" Reject a Deferred object and call any failCallbacks with the given <code>context</code> and <code>args</code>. ","categories":["deferred-object","version/1.5"],"entries":[{"return":"Deferred","signatures":{"added":"1.5","argument":[{"desc":"\n Context passed to the failCallbacks as the <code>this</code> object.\n ","name":"context","type":"Object"},{"desc":"\n An optional array of arguments that are passed to the failCallbacks.\n ","name":"args","type":"Array","optional":"true"}]},"examples":null,"longdesc":"\n <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=\"/deferred.promise/\"><code>deferred.promise()</code></a>.</p>\n <p>When the Deferred is rejected, any failCallbacks added by <a href=\"/deferred.then/\"><code>deferred.then</code></a> or <a href=\"/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=\"/category/deferred-object/\">Deferred object</a>.</p>\n "}]} |