Thursday, 2 January 2020

How do you implement top-level await?

At times, we do not have access to the outer function and so cannot append the async keyword in front of the function. What is the best strategy for using await in such scenarios. This is to avoid the nested .then() callbacks.Once such solution can be using an IIFE but I am not a fan of it. Any ideas?

Submitted January 02, 2020 at 08:54PM by vanillacap

No comments:

Post a Comment