A simple Promise implementation based on Promise A+spec https://promisesaplus.com/
#Major milestones:
- Starting with defining the constructor of new promise to be returned from "then" method Initially coded it as function(which was able to figure out when checking 1 of promises tutorial and playing around in actual code editor rather than pseudo-code) and then later realized I am not returning an object but a function def. This was realized when writing the test adapter in which deferred object needs to have resolve and reject functions both.
Fixed this post pondering upon this further that we can do this by storing the callback references defined outside the scope of that function.
-
A bit misinterpretation in approach understanding
-
Figuring out the correct constructor signature.
-
Arrow functions and 'this' issues, observed during passing tests, took a lot of Time to figure out as many common approaches, like binding this with call and apply, were not working