Async Constructor Functions In TypeScript?
Answer : A constructor must return an instance of the class it 'constructs'. Therefore, it's not possible to return Promise<...> and await for it. You can: Make your public setup async . Do not call it from the constructor. Call it whenever you want to 'finalize' object construction. async function run() { let topic; debug("new TopicsModel"); try { topic = new TopicsModel(); await topic.setup(); } catch (err) { debug("err", err); } } Readiness design pattern Don't put the object in a promise, put a promise in the object. Readiness is a property of the object. So make it a property of the object. The awaitable initialise method described in the accepted answer has a serious limitation. Using await means only one block of code can wait on the action. This is fine for code with guaranteed linear execution but in multi-threaded or event driven code it's unte...