Solid · API

stream.onFinal

Subscribes a listener that is called once, with the final value. On the root stream that is when the closing brace of the reply arrives or when close() is called. On a selected stream it is when the value at that path is complete, which is usually earlier.

Schema
z.object({ show: z.string(), night: z.string() })
Listener
stream.onFinal((value) => calls.push(value))
Stream, chunk by chunk
Reply so far
{"show":"The Tempest",
Listener calls
[]
Output matches the expected value

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