Is there a native way to define a single callback that gets called always regardless of fulfillment or rejection?
This is what I have:
myPromise.then(
function(value) { // fulfillment
alwaysDoThis();
},
function(reason) { // rejection
alwaysDoThis();
}
);
This is what I want:
myPromise.then(
function(value) { // fulfillment or rejection
alwaysDoThis();
}
);
The latter will throw an exception in the case of a rejection, so I know it doesn't do what I want.