In this book you will understand the main ideas of the promise pattern in JavaScript in an evolutionary way, which means at first you would start with nothing and try to meet the needs and improve them slowly.
You would touch everything with your mind.
After reading this book you will be able to implement a promise framework from scratch.
Because of learning the basic concepts in this pattern you might even can see other capabilities there and decide to design a new pattern or evolve a special idea in this pattern.
You can read the entire book for free via the links below and also download all of the examples.
- Introduction
- Start the journey from the simple callback pattern to promise
- Start with a simple variable download the example here
- Initialize with an object instead of undefined download the example here
- Define done method on the object download the example here
- Send the callback to the object download the example here
- Define resolve method download the example here
- Refactor the code download the example here
- Handle the errors download the example here
- Modularize the code download the example here
- Register callbacks after resolving download the example here
- Eliminate nesting by chainable object download the example here
- Eliminate nesting of thenable object download the example here
- Register several callbacks before resolving download the example here
- Implement catch method download the example here
- Implement resolve and reject as static functions download the example here
- Conclusion download the final example here
If you read the book and feel that was kind of useful for you, you can buy a paid version of this book to support me on Leanpub, and pay as much as you think it's worth it.
In the paid version you have access:
- EPUB
- MOBI
- WEB
version of this book.