The Mighty Deferred Promise - An Interview Recount

Описание к видео The Mighty Deferred Promise - An Interview Recount

❗️ See the comments - I over-engineered this, my solution is far from ideal. Good discussion in comments!
👉 I am writing a book on tooling! Check it out: https://lachlan-miller.ck.page/92dfa0...
🐦   / lachlan19900  
I had an interview recently which featured an interesting question. In this video, I share the question and my solution, along with a construct, the mighty deferred promise. There's a TC39 proposal for it under the name "withResolvers": https://github.com/tc39/proposal-prom...

Corrections: 5:00 p-defer isn't necessary here - you can just return a promise. p-defer is useful if you want to resolve or reject the promise afterwards, from outside the location it was originally created. Example improvement: https://gist.github.com/lmiller1990/2.... See comments for discussion.

Комментарии

Информация по комментариям в разработке