3 ms·
Async await in python and in JS work exactly the same way (except that you have to explicitly launch an event loop in python). I have developed a library that m
by crubier 6y ago
Async await in python and in JS work exactly the same way (except that you have to explicitly launch an event loop in python). I have developed a library that makes heavy uses of promises and async generators, and the code for the python and JS version are extremely similar. Like similar enough that an automatic translation could be done.
And yes, forget about .then and other old school stuff like that in JS. Just use async await to deal with promises.