Refactored Promise for simplicity
The original v1 release of this library was feature complete, but it was based on the complex design of CommonJS Promises. There were a number of issues that arose from the design limitations imposed by this decision, but the unit tests were already in place, so it was worth it to refactor the Promise class completely.
The new implementation has the same external functionality, but with two main improvements: 1) much better compatibility with Web API Promises; 2) much, much simpler.
The main point of this refactor is to move to a simpler queue-based system, rather than a recursive one. You can see the queue in action as the Promise's chain
property, which will contain a reference to each of the new Chainable
objects: ThenChain
, CatchChain
and FinallyChain
.
Have fun!