I want to add a pathconfig value that would be fetched from the async function to the property in the constructor ,the tech stack is Nodejs and Typescript.
I tried to assign value to the property in the below way,
constructor() {
const securitiesConfig = {
pathConfig: (
async () => {
return await this.getIenantConfigDetails();
}
)(),
logger:logger,
auditlogger:logger
};
console.log(securitiesConfig)
}
but the issue is it does not wait for the function to complete execution and return value so pathconfig does not have the desired value ,what can be done differently to fix the above issue.
I used Immediately executing async func with expectation that it would make it wait and assign proper value but it doesnt work
expecting a workaround or proper approach for the query.