Beta (still building)

first

first Operator emits only the first value.

you also can pass personalized compare function: see this example

Example: first operator

import { interval } from 'rxjs';
import { first, take } from 'rxjs/operators';

const source$ = interval(1500).pipe(take(4));
const result$ = source$.pipe(first());

Example: first Operator with custom compare function

return the first 2 value

import { interval } from 'rxjs';
import { first, take } from 'rxjs/operators';

const source$ = interval(1500).pipe(take(4));
const result$ = source$.pipe(first((i) => i === 2));

Official Doc: rxjs.first