4 ms·
Sometimes (most of the time?) you want to run two async functions in series because the input of one function depends on the output of the other, or because you
by eat_veggies 6y ago
Sometimes (most of the time?) you want to run two async functions in series because the input of one function depends on the output of the other, or because you want the side effects of each to happen in the correct order. This is the whole point of promise chaining and the async/await sugar on top of it. Concurrency is hard, and I am glad that the default is something predictable but slow, rather than fast and racy.
- enedil 6y agoExcept the default is exactly fast and racy: fetch(x); fetch(y); vs await fetch(x); await fetch(y);