RxJs Concepts Flashcards

1
Q

pipe

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

map

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

retry

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

catchError

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly