Skip to content

sushaanttb/promise

Repository files navigation

testPromise

A simple Promise implementation based on Promise A+spec https://promisesaplus.com/

#Major milestones:

  1. 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.

  1. A bit misinterpretation in approach understanding

  2. Figuring out the correct constructor signature.

  3. 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

About

Implementing Promise based on Promise A+ spec

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published