i use Ionic 3.5.2, i tried await/async piece of code and it work as espected. Is it safe to use in production? There some restrictions on destination platforms?

Thanks in advance.

It’s probably safe except on IE. The problem with async/await code is that it tends to be anti-typescript, so if you write with async/await instead of with typed Promises and Observables, you aren’t making full use of Angular/Typescript. But that’s a style issue, and maybe you don’t even like Typescript.

Thanks i mean if is safe on mobile phones, like hybrid app. For the promise style i feel less confortable, i come from C# so async/await are more familiar. There is a way to do a sync sleep with promise? Like:

while(true) {
if (i > 10) break;
await delay(100);

where delay is

function delay(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));


1 Like

Why do you feel the need to do this? Resources are limited on mobile devices; why waste them?

(Excuse the delay…)

I have a couple of circustances where i need it: for instance we have a configuration class that need to use secure storage. before start i need to inizialize, as usual is done with a promise. But in this way i have a lot of nested then that are (for me) a bed way to accomplish the task. With await i can manage this with await. The cose is more readable.

Maybe there are some techniques/arch that i don’t know…

Shouldn’t ever need to nest then; just chain them.

You intend with Promise.all?

Hard to say more definitively without seeing code.



Nice example on chaining



Interesting link thanks