takes the first values
ngOnInit() { // produces a number every one second const numbers$ = Observable.interval(1000); numbers$.pipe( take(5) // take first 5 values from that observable ) .subscribe(x => console.log(x); ) }