Search posts, tags, users, and pages
Rupert McKay
Staff Software Engineer at Lokalise
Key takeaways: Promises can run code after some other code has completed async/await is just syntactic sugar Promise.all is great for parallel tasks What is a Promise? A promise is some task that we can use to chain together later tasks. For exampl...
Axel Rauschmayer
I specialize in JavaScript.
Another option for parallelism:
const getAllUsersAndProducts1 = async () => { const [users, products] = await Promise.all([ fetchAllUsers(), fetchAllProducts(), ]); return { users, products }; };
Axel Rauschmayer
I specialize in JavaScript.
Another option for parallelism:
const getAllUsersAndProducts1 = async () => { const [users, products] = await Promise.all([ fetchAllUsers(), fetchAllProducts(), ]); return { users, products }; };