In my TypeScript code, there is a static class with an async build method as shown below:
export default class DbServiceInit {
public static myProperty: string;
public static build = async(): Promise<void> => {
try {
DbServiceInit.myProperty = "ssss";
console.log('My Static Class', DbServiceInit)
} catch (error) { console.error(error); }
}
}
When I invoke it like this:
await DbServiceInit.build();
It displays an empty class in the log:
My Static Class class DbServiceInit {
}
I am puzzled by this behavior because I expected the following output:
My Static Class class DbServiceInit {
myProperty: 'ssss'
}