Skip to main

of

of

Signature - source.ts#L750

function of<T>(...items: T[]): Source<T>

Creates a Source from the given values. The values will be synchronously emitted by the created source upon each subscription.

Returns

TypeDescription
Source<T>

The created source.

Example Usage

pipe(of(1, 2, 3, 4), subscribe(Sink(console.log)));
// Logs:
// Push(1), Push(2), Push(3), Push(4)
// End

Example Usage

pipe(of(), subscribe(Sink(console.log)));
// Logs:
// End

See Also