take

3
a$.pipe(
  take(3)
).subscribe((b) => {
  console.log(b);
})