Merge pull request #3214 from jbblanchet/master

Add when signature for Promise<void>
This commit is contained in:
Masahiro Wakame
2014-11-25 10:20:16 +09:00
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -94,6 +94,7 @@ Q.fbind((dateString?: string) => new Date(dateString), "11/11/1991")().then(d =>
Q.when(8, num => num + "!");
Q.when(Q(8), num => num + "!").then(str => str.split(','));
var voidPromise: Q.Promise<void> = Q.when();
declare function saveToDisk(): Q.Promise<any>;
declare function saveToCloud(): Q.Promise<any>;
Vendored
+3
View File
@@ -188,6 +188,9 @@ declare module Q {
reason?: any;
}
// If no value provided, returned promise will be of void type
export function when(): Promise<void>;
// if no fulfill, reject, or progress provided, returned promise will be of same type
export function when<T>(value: IPromise<T>): Promise<T>;
export function when<T>(value: T): Promise<T>;