From f1ce5d9731bfc73325afef738ae275e84225a41d Mon Sep 17 00:00:00 2001 From: portix Date: Thu, 17 Jan 2013 00:20:25 +0100 Subject: Implemnting Deferred.always --- api/dwb-js.7 | 27 ++++++++++++++++++++++++--- api/jsapi.7.txt | 13 ++++++++++++- api/jsapi.txt | 21 ++++++++++++++++++++- 3 files changed, 56 insertions(+), 5 deletions(-) (limited to 'api') diff --git a/api/dwb-js.7 b/api/dwb-js.7 index 9a51c580..8964b910 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 -.\" Date: 01/09/2013 +.\" Date: 01/17/2013 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "DWB\-JS" "7" "01/09/2013" "\ \&" "\ \&" +.TH "DWB\-JS" "7" "01/17/2013" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -824,7 +824,7 @@ Executes a shell command using the default search path The command to execute .RE .PP -\fIstdin(String)\fR +\fIstdout(String)\fR .RS 4 Callback function for stdin, pass null if only stderr is needed, optional .RE @@ -1152,6 +1152,27 @@ Deferreds implement the following methods: .nr an-break-flag 1 .br .ps +1 +\fBvoid Deferred.always(Function callback)\fR +.RS 4 +.sp +Registers a function for then done and fail chain\&. +.PP +\fIcallback\fR +.RS 4 +A callback function that will be called when the Deferred is resolved or rejected\&. If the function returns a deferred the original deferred will be replaced with the new deferred\&. +.RE +.PP +\fIreturns\fR +.RS 4 +A new deferred that can be used to chain callbacks\&. +.RE +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 \fBvoid Deferred.done(Function callback)\fR .RS 4 .sp diff --git a/api/jsapi.7.txt b/api/jsapi.7.txt index cc79f73b..ec361e4d 100644 --- a/api/jsapi.7.txt +++ b/api/jsapi.7.txt @@ -378,7 +378,7 @@ _returns_;; true if creation was successful or directory already existed Executes a shell command using the default search path _command_;; The command to execute -_stdin(String)_;; Callback function for stdin, pass null if only stderr is +_stdout(String)_;; Callback function for stdin, pass null if only stderr is needed, optional _stderr(String)_;; Callback function for stderr, optional _returns_;; A deferred, it will be resolved if the child exits @@ -533,6 +533,17 @@ the fail callback chain of the deferred is called. Deferreds implement the following methods: +==== void Deferred.always(Function callback) +**** + +Registers a function for then done and fail chain. + +_callback_;; A callback function that will be called when the Deferred is +resolved or rejected. If the function returns a deferred the original deferred will be replaced with +the new deferred. +_returns_;; A new deferred that can be used to chain callbacks. +**** + ==== void Deferred.done(Function callback) **** diff --git a/api/jsapi.txt b/api/jsapi.txt index 0de6b314..9ad2fe30 100644 --- a/api/jsapi.txt +++ b/api/jsapi.txt @@ -652,7 +652,7 @@ Executes a shell command using the default search path :: _command_;; The command to execute -_stdin(String)_;; Callback function for stdin, pass +null+ if only stderr is +_stdout(String)_;; Callback function for stdin, pass +null+ if only stderr is needed, optional _stderr(String)_;; Callback function for stderr, optional _returns_;; A deferred, it will be resolved if the child exits @@ -1080,6 +1080,25 @@ Deferreds implement the following methods: [float] ==== *done()* ==== +[source,javascript] +---- +Deferred Deferred.always(Function callback) +---- + +Registers a function for then done and fail chain. + + :: + +_callback_;; A callback function that will be called when the Deferred is +resolved or rejected. If the function returns a deferred the original deferred will be replaced with +the new deferred. +_returns_;; A new deferred that can be used to chain callbacks. +**** + +**** +[float] +==== *done()* ==== + [source,javascript] ---- Deferred Deferred.done(Function callback) -- cgit v1.2.3