-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
promise.catch
When the catch method is called with argument onRejected the following steps are taken:
- Let promise be the this value.
- Return Invoke(promise,
"then", (undefined, onRejected)).
promise.finally
not part of the spec yet, was postponed to ES7.
It is useful for ensuring a callback is run regardless of the promise it chains's fate. Also it's returned promise is fated to the promise it was chained from and as such as no ability to effect downstream outcomes.
In practice this is useful for ensuring cleanup regardless of outcome.
RXPromise *promise = [RXPromise resolveWith: 1]
promise.finally(^{
// void, no possible way to effect downstream fate
}).then(^((int) value){
// value == 1
}, nil)