Solid · Completion
Field completion
A field is complete when the next key is named: a reply is written left to right, so nothing more can arrive for the field before it. The last field is complete at the closing brace of the reply. In the example house closes its brace in chunk 2 and its onFinal listener is called in chunk 3, when bookings is named.
z.object({
night: z.string(),
house: z.object({ seats: z.number(), sold: z.number(), left: z.number() }),
bookings: z.object({ count: z.number(), largest: z.string() }),
advice: z.string(),
})for (const part of ['night', 'house', 'bookings', 'advice']) stream.select(part).onFinal(() => completed.push(part))
Stream, chunk by chunk
{"night":"2026-10-24",[]
Runs in this page on the installed package. The input and the expected output are defined by the example.