When working with AngularJS services, TypeScript often recommends that I switch my code to use async
/await
functions.
https://i.sstatic.net/vks1i.png
While I understand that using the await
keyword is compatible with third-party promises because it essentially translates to calling then
, I typically stick with returning Angular promises to ensure smooth interaction with the digest cycle.
https://i.sstatic.net/vVpYO.png
Even though async
functions wrap their content in an ES6 promise, I encounter an error in this particular code. I wonder if this will impact Angular scheduling, considering that the returned promise is still connected to an Angular-generated one. Should I consider raising a concern with TypeScript for suggesting async
/await
when functions don't explicitly return an ES6 promise?