Struggling with a code like the one below
I am attempting to make the function return true if the user is the current user. However, the issue I am facing is that the code execution does not wait and completes before this section of code is executed?
Would it be necessary to use async and await in this scenario?
What steps should I take in Typescript to ensure that the program waits to obtain the value of `resultSet` here?
P.S : I am still new to Typescript
const resultSet= WorkItemFormService.getService().then(
function(ServiceWTest){
const b=ServiceWTest.getFieldValues([userField]).then(function(value)
{
var a=false;
if(currentUser==actualUser)
{
a=true;
}
else
{
}
return Promise.resolve(a);
});
return Promise.resolve(b);
});
var actiona=resultSet.toString();