async await

using promises:

something()
.then(response => {
return another(response.id);
})
.then(response => {
console.log("another promise");
})
.catch()

async await version:

async blah() {
response1 = await something();
response2 = await another(response1.id);
}

Posted in A2Z

Leave a Reply

Your email address will not be published. Required fields are marked *