Solid · Partial values

Partial numbers

A number is exposed with the digits received so far, so a partial value can be smaller than the final one: 7600 reads as 76 when a chunk ends inside it. Nothing in the digits indicates that more will follow. Use a number only after its path is complete, as the example does with select('price_cents').onFinal.

Schema
z.object({
  show: z.string(),
  night: z.string(),
  seats: z.array(z.string()),
  price_cents: z.number(),
  why: z.string(),
})
Listener
stream.select('price_cents').onFinal(() => { complete = true })
Stream, chunk by chunk
Reply so far
{"show":"The Tempest","night":"2026-10-24",
"seats":["C4","C5"],"price_cents":76
price_cents and completion
{ price_cents: 76, complete: false }
Output matches the expected value

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