map, filter and tap in RxJS — a practical guide to RxJS map filter tap with clear examples you can reuse in real projects.
Angular Tutorial Series (62/119). Prefer one article? Read the complete Angular tutorial.
Short description
tap is for logging/analytics — keep pure transforms in map.
map filter tap
this.http.get<User[]>('/api/users').pipe(
tap((users) => console.log(users.length)),
map((users) => users.map((u) => u.name)),
filter((names) => names.length > 0)
);