Solid · API

stream.on

Subscribes a listener to the value. The listener is called immediately with the current value, then after every write that changes it: chunks 3 and 5 of the example change nothing and cause no call. Returns an unsubscribe function.

Schema
z.object({ show: z.string(), night: z.string() })
Listener
stream.on((value) => calls.push(value))
Stream, chunk by chunk
Listener calls
[{ show: '', night: '' }]
Output matches the expected value

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