Search posts, tags, users, and pages
async/await vs promises
Rupert McKay
@fildon · Delft, The Netherlands
Staff Software Engineer at Lokalise
Markdown supported · ⌘↵ to post
Axel Rauschmayer
Another option for parallelism:
const getAllUsersAndProducts1 = async () => { const [users, products] = await Promise.all([ fetchAllUsers(), fetchAllProducts(), ]); return { users, products }; };
Axel Rauschmayer
Another option for parallelism:
const getAllUsersAndProducts1 = async () => { const [users, products] = await Promise.all([ fetchAllUsers(), fetchAllProducts(), ]); return { users, products }; };