Rendering

Parallel data fetching pattern

JavaScript composition pattern, not a Next.js API. Start independent tasks before awaiting; Promise.all rejects on rejection and does not cancel other work by itself. Source: https://nextjs.org/docs/app/getting-started/fetching-data

Formal Syntax & Structure

nextjs syntaxnextjs
await Promise.all([firstPromise, secondPromise])

Working Example

Example Snippetnextjs
async function title(){return 'Fern walk';}async function count(){return 3;}async function summary(){ const titlePromise=title(); const countPromise=count(); const [name,articles]=await Promise.all([titlePromise,countPromise]); return `${name}: ${articles}`;}summary().then(console.log);
Next.js Reference