roko
0
Q:

js class async constructor

function asyncRequest(id){
	return new Paormise(/*.....*/);
}
class MyClass {
	constructor(name, age, cityId) {
    	(async function() {
          this.name = name;
          this.age = age;
          this.city = await asyncRequest(cityId);
        })();
    }
}
2

New to Communities?

Join the community