Restored optionality.

This commit is contained in:
Daniel Rosenwasser
2016-02-03 11:20:20 -08:00
parent 0a82642ce7
commit 290a1d7ee6
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -291,9 +291,9 @@ fooProm = fooProm.caught((error: any) => {
fooProm = fooProm.catch((reason: any) => {
//handle multiple valid return types simultaneously
if (true) {
if (foo === null) {
return;
} else if (false) {
} else if (!reason) {
return voidProm;
} else if (foo) {
return foo;
+3 -3
View File
@@ -407,8 +407,8 @@ interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
/**
* Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error.
*/
done<U>(onFulfilled: (value: T) => PromiseLike<U>, onRejected: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): void;
done<U>(onFulfilled: (value: T) => U, onRejected: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): void;
done<U>(onFulfilled?: (value: T) => PromiseLike<U>, onRejected?: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): void;
done<U>(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): void;
/**
* Like `.finally()`, but not called for rejections.
@@ -459,7 +459,7 @@ interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
/**
* Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors.
*/
fork<U>(onFulfilled: (value: T) => U | PromiseLike<U>, onRejected: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): Promise<U>;
fork<U>(onFulfilled?: (value: T) => U | PromiseLike<U>, onRejected?: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): Promise<U>;
/**
* Create an uncancellable promise based on this promise.