StreamSource
type StreamSource<T> = | StreamSourceInstance<T> | (() => StreamSourceInstance<T>);Defined in: stream-source.ts:29
A stream source can be an instance OR a factory function that creates one.
Factory functions are useful when you want to defer creation of the stream, or when the same stream needs to be re-created multiple times.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Example
Section titled “Example”// Instanceconst source: StreamSource<number> = [1, 2, 3];
// Factory functionconst source: StreamSource<number> = () => generateNumbers();