Async/Await
Use async/await with Python's Transcrypt.
We'll cover the following
Introducing async/await
While the promise model does allow us to make asynchronous calls to our back-end server, the model tends to be a bit clunky. It can not only be difficult to catch errors but can also be difficult to debug with all the callbacks and promise
objects. For this reason, many people prefer to use the async/await model instead, which wraps the promise model and allows our code to look more like it would if we were using a synchronous approach.
We can change our Python fetch()
function to use the async/await model instead of the promise model in jsutils.py
.
Get hands-on with 1400+ tech skills courses.