Answers for "await constructor typescript"

0

await constructor typescript

class MyClass {
   private mMember: Something;

   // make private if possible; I can't in TS 1.8
   constructor() {
   }

   public static CreateAsync = async () => {
      const me = new MyClass();
      
      me.mMember = await SomeFunctionAsync();

      return me;
   };
}
Posted by: Guest on September-18-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language