3 ms·
If you want to use ‘await’, the calling scope needs to be an async function, which means any other function which calls the now async caller also needs to be as
by dkdbejwi383 5y ago
If you want to use ‘await’, the calling scope needs to be an async function, which means any other function which calls the now async caller also needs to be async (well, if you need the resolved value. You can just orphan promises but then you’ll probably have unintended consequences). You’re forced to propagate it up the chain, which one may argue is a leaky abstraction.