async / await and promise



To ensure we make the correct async / await call, we still need Promises to resolve our task. Promise is like a marker that helps signified a task has been completed.

Pretty sure if you don't make use of promise, it is very unlikely that your function is awaited.

In this example, we're calling a long running external call to a service and then uses await to 'wait' for the results.

Results are then output into the console.










Comments

Popular posts from this blog

A quick tutorial for OWASP ZAP tool for beginners

ionic2 cordova build android - Unable resolve gradle 2.2.3