November 21st, 2015
(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: email@example.com
Promises have three possible mutually exclusive states: fulfilled, rejected, and pending.
A promise is fulfilled if promise.then(f) will call f “as soon as possible.”
A promise is rejected if promise.then(undefined, r) will call r “as soon as possible.”
A promise is pending if it is neither fulfilled nor rejected.
We say that a promise is settled if it is not pending, i.e. if it is either fulfilled or rejected. Being settled is not a state, just a linguistic convenience.