skip to Main Content

JAVASCRIPT: Class method returns a promise. But I want it to return the resolved result. How do I rewrite the class method?

This is my class. export MyClass { private readonly ServiceEndpoint: string = "/xxx/xxx.DMS.UI.Root/Services/ConfigurationAPI.svc/";   public async GetAllCompanies(): Promise<CompanyDto[]> { return fetchAsync( `${this.ServiceEndpoint}Company`, 'GET' ) .then(value => value.GetAllCompaniesResult); } } Presently, this method returns a Promise <CompanyDto[]>. How do I rewrite…

VIEW QUESTION
Back To Top
Search