Solid · API

stream.final

Returns a promise that resolves with the final value. On the root stream it resolves when the closing brace of the reply arrives. On a selected stream it resolves as soon as the value at that path is complete: in the example select('seats').final() resolves, and the seats can be used, while why is still streaming.

Schema
z.object({
  show: z.string(),
  night: z.string(),
  seats: z.array(z.string()),
  price_cents: z.number(),
  why: z.string(),
})
Promises
const seats = stream.select('seats').final()
const whole = stream.final()
Stream, chunk by chunk
Reply so far
{"show":"The Tempest","night":"2026-10-24",
"seats":["C4","C5"]
Promise states
{ seats: 'waiting', whole: 'waiting' }
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.