DEV Community

Discussion on: The Proper Way to Write Async Constructors in JavaScript

Collapse
 
kayis profile image
K

Pretty illuminating, thanks!

First, I was baffled for when I would need this.

But then I saw the async factory function and remembered that I wrote this multiple times, I just didn't call it an async constructor, haha.

I also like the first idea with returning a promise. I think Ember.js did this in many places.