InterviewHubPRO
Section Overview
Q48

Question 48 of 283

Part 2: HttpClient, RxJS Observables & Angular Elements (36 - 62)

17%
Angular & Signals (283 Qs)•Part 2: HttpClient, RxJS Observables & Angular Elements (36 - 62)

What are the utility functions provided by RxJS?

The RxJS library also provides below utility functions for creating and working with observables.

  1. Converting existing code for async operations into observables
  2. Iterating through the values in a stream
  3. Mapping values to different types
  4. Filtering streams
  5. Composing multiple streams

Practical Code Example

typescript
// RxJS Pipeable Utility Operators:
import { of } from 'rxjs';
import { map, filter, catchError, debounceTime } from 'rxjs/operators';

const source$ = of(1, 2, 3, 4, 5);

source$.pipe(
  filter(n => n % 2 !== 0), // 1, 3, 5
  map(n => n * 10)          // 10, 30, 50
).subscribe(val => console.log(val));