Stream
Stream:
object
Defined in: Core/Stream.ts:42
Type Declaration
Section titled “Type Declaration”emit: <
S,K>(target,message) =>void=emitStream
Emits a message payload to one or more target streams.
Uses a synchronous breadth-first trampoline queue to handle re-entrant emissions deterministically.
Type Parameters
Section titled “Type Parameters”S extends Record<string, unknown>
K extends string
Parameters
Section titled “Parameters”target
Section titled “target”Stream<S> | readonly Stream<S>[]
message
Section titled “message”WithKind<K> & WithValue<S[K]>
Returns
Section titled “Returns”void
Example
Section titled “Example”forward
Section titled “forward”forward: <
S>(options) => () =>void=forwardStream
Forwards messages from one stream to another (or multiple).
Type Parameters
Section titled “Type Parameters”S extends Record<string, unknown>
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”() => void
Example
Section titled “Example”listen
Section titled “listen”listen: <
S,K>(stream,events,options?) =>ListenerBuilder<S> =listenStream
Initiates listener registration on a stream for specific event kind(s) or sequence.
Type Parameters
Section titled “Type Parameters”S extends Record<string, unknown>
K extends string
Parameters
Section titled “Parameters”stream
Section titled “stream”Stream<S>
events
Section titled “events”K | readonly K[]
options?
Section titled “options?”Returns
Section titled “Returns”Example
Section titled “Example”make: <
S>(options?) =>Stream<S> =makeStream
Constructs a new Stream instance.
Type Parameters
Section titled “Type Parameters”S extends Record<string, unknown>
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Stream<S>