Assertion: promise | /r/HasProperty | settled
Facets:
Source sentences:
text: A promise is settled if it’s not pending (it has been resolved or rejected).
text: A promise that is either resolved or rejected is called “settled”, as opposed to an initially “pending” promise.
text: Once a promise is settled, it must have a value (which may be undefined ).
text: For example, in this version, handleCancel will be called if you cancel the promise after it is already settled.
text: Note: A promise is said to be settled if it is either fulfilled or rejected, but not pending.
text: this means that the promise is settled or “locked in” to match the state of another promise.
text: The handler is called when the promise is settled, whether fulfilled or rejected.
text: The call .finally(f) is similar to .then(f, f) in the sense that f always runs when the promise is settled: be it resolve or reject.
text: // runs when the promise is settled, doesn't matter successfully or not .finally
text: These callbacks are called when the Promise is settled (i.e. either fulfilled or rejected).
text: So, in the world of promises, we’re not interested in knowing when the promise is settled.
text: But if you return a promise inside then() , the next then() waits on it and gets called when that promise is settled.