diff options
author | portix <portix@gmx.net> | 2012-12-08 00:07:55 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-12-08 00:07:55 +0100 |
commit | e546c944645580065fd7b8df7f2e048f11d26311 (patch) | |
tree | c118c4f11485bd9f4bc963c1ae436b2ceaefff4a /api | |
parent | 258e4e4b60c69c2d47369d15003cac863444b1d8 (diff) | |
download | dwb-e546c944645580065fd7b8df7f2e048f11d26311.zip |
Don't break a callback chain of a deferred if one callback function is missing
Diffstat (limited to 'api')
-rw-r--r-- | api/dwb-js.7 | 12 | ||||
-rw-r--r-- | api/jsapi.7.txt | 9 | ||||
-rw-r--r-- | api/jsapi.txt | 7 |
3 files changed, 13 insertions, 15 deletions
diff --git a/api/dwb-js.7 b/api/dwb-js.7 index db781718..b3cc9a31 100644 --- a/api/dwb-js.7 +++ b/api/dwb-js.7 @@ -2,12 +2,12 @@ .\" Title: dwb-js .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/> -.\" Date: 12/07/2012 +.\" Date: 12/08/2012 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "DWB\-JS" "7" "12/07/2012" "\ \&" "\ \&" +.TH "DWB\-JS" "7" "12/08/2012" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1292,7 +1292,7 @@ foo()\&.fail(onResponse)\&.fail(onResponse); .RE .\} .sp -Note that if the deferred is rejected only the fail chain is called, when it is resolved only the done chain is called\&. It is not possible to mix up done and fail chain\&. +Note that if the deferred is rejected only the fail chain is called, when it is resolved only the done chain is called\&. .sp .if n \{\ .RS 4 @@ -1314,10 +1314,10 @@ function onResponse(response) io\&.print(response); } -// Will not be executed at all\&. -foo()\&.done(onResponse)\&.fail(onResponse); -// Only the first callback is executed +// Only the fail will be executed + foo()\&.fail(onResponse)\&.done(onResponse); +foo()\&.done(onResponse)\&.fail(onResponse); .fi .if n \{\ .RE diff --git a/api/jsapi.7.txt b/api/jsapi.7.txt index 3a2ca7cd..a0d223d4 100644 --- a/api/jsapi.7.txt +++ b/api/jsapi.7.txt @@ -631,8 +631,7 @@ foo().fail(onResponse).fail(onResponse); --------------------------------- Note that if the deferred is rejected only the fail chain is called, when it is -resolved only the done chain is called. It is not possible to mix up done -and fail chain. +resolved only the done chain is called. [source,javascript] --------------------------------- function foo() @@ -651,10 +650,10 @@ function onResponse(response) io.print(response); } -// Will not be executed at all. -foo().done(onResponse).fail(onResponse); -// Only the first callback is executed +// Only the fail will be executed + foo().fail(onResponse).done(onResponse); +foo().done(onResponse).fail(onResponse); --------------------------------- Changing the deferred in a callback chain: diff --git a/api/jsapi.txt b/api/jsapi.txt index b04c583a..cb411b95 100644 --- a/api/jsapi.txt +++ b/api/jsapi.txt @@ -1205,8 +1205,7 @@ foo().fail(onResponse).fail(onResponse); --------------------------------- Note that if the deferred is rejected only the fail chain is called, when it is -resolved only the done chain is called. It is not possible to mix up done -and fail chain. +resolved only the done chain is called. [source,javascript] --------------------------------- function foo() @@ -1225,9 +1224,9 @@ function onResponse(response) io.print(response); } -// Will not be executed at all. +// Only the fail will be executed + foo().done(onResponse).fail(onResponse); -// Only the first callback is executed foo().fail(onResponse).done(onResponse); --------------------------------- |