Couple of things.
If you assign a Promise to a variable, it’s value, once resolved, will always be available on that variable. There is no race condition when attaching
.then‘s to the promise chain.
You’ve also missed out a couple of things.
.catch are methods on the Promise instance itself. There is also a
.done which ends the chain.
reject are function passed in to the constructor of a Promise, to let it know what values to set it’s internal
error values to. That’s not quite how they work, but pretty close.
Really nice write up, tho. I’d encourage you to go have a look at the ES Stage 3 proposal for async-await. You can use it now through a babel transform.