Solid · Partial values

Partial strings

A string field is in the partial value from its first character and grows with every chunk. Text can be rendered while the model is still writing it: in the example answer grows under a card title that arrived complete in the first chunk.

Schema
z.object({
  card: z.object({ kind: z.string(), title: z.string() }),
  answer: z.string(),
  sources: z.array(z.string()),
})
Stream, chunk by chunk
Reply so far
{"card":{"kind":"answer","title":"Your seats"},
Current value
{
  card: { kind: 'answer', title: 'Your seats' },
  answer: '',
  sources: [],
}
Output matches the expected value

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