Beta (still building)

take

take operator emits indicated count of values from source observable.

Example: take operator

import { interval } from 'rxjs';
import { take } from 'rxjs/operators';
 
const source$ = interval(1000);
const result$ = source$.pipe(take(5));

Example: take operator with click event

import { fromEvent } from 'rxjs';
import { take } from 'rxjs/operators';
 
const source$ = fromEvent(document, 'click');
const result$ = source$.pipe(take(5));

Official Doc: rxjs.take