Skip to main content

firstObservablePipe

Alternative: first$$$

Inlined: firstObservable, first$$

Types

function firstObservablePipe<GValue>(): IObservablePipe<GValue, GValue>

Definition

This pipe emits only the first value emitted by the source Observable.

The RxJS equivalent is first.

Diagram

Example

Emit only the first value sent

const subscribe = pipe$$(of(1, 2, 3, 4), [
first$$$<number>(),
]);

subscribe((value: number) => {
console.log(value);
});

Output:

1