RxJs Concepts Flashcards
pipe
pipe() can be called on one or more functions, each of which can take one argument (“UnaryFunction”) and uses it to return a value. It returns a function that takes one argument, passes it to the first UnaryFunction, and then passes the result to the next one, passes that result to the next one, and so on.
Returns a new value
map
Applies a given project function to each value emitted by the source Observable, and emits the resulting values as an Observable.
map<T, R>(project: (value: T, index: number) => R, thisArg?: any): OperatorFunction<T, R>
Returns
OperatorFunction<T, R>: A function that returns an Observable that emits the values from the source Observable transformed by the given project function.
https://rxjs.dev/api/index/function/map#map
retry
Returns an Observable that mirrors the source Observable with the exception of an error.
Returns
OperatorFunction<T, R>: A function that returns an Observable that emits the values from the source Observable transformed by the given project function.
https://rxjs.dev/api/index/function/retry#retry
catchError
Catches errors on the observable to be handled by returning a new observable or throwing an error.
catchError<T, O extends ObservableInput<any>>(selector: (err: any, caught: Observable<T>) => O): OperatorFunction<T, T | ObservedValueOf<O>></O></T></any>
Returns
OperatorFunction<T, T | ObservedValueOf<O>>: A function that returns an Observable that originates from either the source or the Observable returned by the selector function.</O>
https://rxjs.dev/api/index/function/catchError#catcherror