WebJs Gallery
← Gallery

Streaming actions

A 'use server' action that returns an async function* streams each yield over the single RPC response. The call site consumes it with for await (const chunk of await streamTokens()), so tokens render as they arrive instead of waiting for the whole result.

Detection is on the return value (no config export), and a streamed result is never cached, ETagged, or seeded. The source generator is cancelled if the client navigates away mid-stream.