This repository is for learning purposes: reimplementing promises using TDD baby steps. You will not find here any complete production ready promise implementation. Most of the code remains in promise.test.ts file. If you need some hints to get started, you can take a look et the different branches of this repository (one branch per TDD baby step). There are only 7 branches and obviously the implementation found in the last branch is far from being completed, does not deal with failures and most edge cases. The purpose here is to demystify promises for beginners.
The spec: https://github.com/promises-aplus/promises-spec
To go a little further on promises: https://blog.jcoglan.com/2013/03/30/callbacks-are-imperative-promises-are-functional-nodes-biggest-missed-opportunity/
Some alternatives to promises:
- fp-ts Task(Either/Option): https://dev.to/ryanleecode/practical-guide-to-fp-ts-p3-task-either-taskeither-2hpl
- RxJs observables: https://rxjs.dev/