0Pricing
Sveltejs Academy · Lesson

Streaming Data with Promises in load

Return unresolved promises from load to stream data after the initial HTML.

Why Stream

Streaming load lets the page render before slow data resolves, improving perceived performance.

Return Promises

Return data with some properties as unresolved promises.

export async function load() {
  return {
    fast: getFastData(),
    slow: getSlowData()   // promise, not awaited
  };
}

All lessons in this course

  1. Streaming Data with Promises in load
  2. Deferred Loading and Suspense-Like UX
  3. Streaming from Server with +server.js
  4. Progressive Hydration
← Back to Sveltejs Academy