R
Reactiflux

Adi – 10-07 May 14

Adi – 10-07 May 14

AAdi5/14/2022
Can I have async method which is used in constructor for intialization? something like this:
class Foo {
constructor () {
this.initialize();
}

async initialize () {

const res = await randomMethod();
const res2 = await randomMethod2();

}
}
const bar = new Foo();
class Foo {
constructor () {
this.initialize();
}

async initialize () {

const res = await randomMethod();
const res2 = await randomMethod2();

}
}
const bar = new Foo();
Do I need to use await this.initialize(); I checked the code without await also it is working
UUUnknown User5/14/2022
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

Adi – 10-07 May 14

Join Server
Want results from more Discord servers?
Add your server