Skip to content

Documentation / @eventkit/base / StreamInit

Type Alias: StreamInit<T> ​

ts
type StreamInit<T> = object;

Configuration options for creating a Stream.

This type defines optional parameters that can be passed to the Stream constructor to customize its behavior, including preprocessing of values and scheduler configuration.

Type Parameters ​

Type ParameterDescription
TThe type of values emitted by the Stream

Properties ​

scheduler? ​

ts
optional scheduler: 
  | SchedulerLike
  | () => SchedulerLike;

Scheduler to use for managing the execution of the inner observable. Can be provided as either a constructor function or an instance. If not provided, the default Scheduler will be used.

Methods ​

preprocess()? ​

ts
optional preprocess(value): T

Function to preprocess values before they are pushed to observers. This can be used to validate values before they are emitted.

Parameters ​

ParameterTypeDescription
valueunknownThe raw value to be preprocessed

Returns ​

T

The processed value that will be emitted to observers

Released under the MIT License.