Skip to content

Function: createStreamBuilder() ​

ts
function createStreamBuilder<TEvent, TPayload>(id, options?): StreamBuilder<TEvent, TPayload>;

Defined in: builders/create-stream-builder.ts:24

Creates a fluent StreamBuilder for P.stream(id).

Validates that id is non-empty and returns a copy-on-write immutable builder that compiles into a deeply frozen StreamNode.

Type Parameters ​

Type ParameterDefault typeDescription
TEventunknownInbound event type.
TPayloadunknownOutbound signal payload type.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the stream.
options?CreateStreamBuilderState<TEvent, TPayload>Optional internal copy-on-write state.

Returns ​

StreamBuilder<TEvent, TPayload>

Frozen StreamBuilder instance.

Released under the MIT License.