- Streams vs Observables
- Error handling in subscribe
- Create observable that handles fetch request
- Noop
- Map
- Example of reactive design: beginner courses and advanced courses with individual observables based on 1 http observable and 1 courses observable filtering out the payload of the fetch request => too many http requests
- tap()
- shareReplay()
- concat()
- filter()
- of(), fromPromise(), from()
- concatMap()
- merge()
- mergeMap()
- exhaustMap() + AbortController
- debounceTime()
- switchMap()
- catchError() + throwError() + response.ok
- finalize()
- retryWhen() + delayWhen()
Example:
retryWhen(errors => errors.pipe(delayWhen(() => timer(2000)));
- startWith()
- throttleTime() / throttle()
throttle(() => interval(500));
- custom operator
const debug = (message) => {
return (source: Observable<any>) => {
return source.pipe(
tap(val => console.log(message))
);
}
}
-
forkJoin()
-
createHttpObservable function
-
Subject = Observable and Observer at the same time
- Subject is meant to be private to any component
- If you want to share the subject then use subject.asObservable()
-
BehaviorSubject()
-
AsyncSubject()
- What happens to late subscribers?
-
ReplaySubject()
- What happens to late subscribers?
-
first(), take(x)
-
withLatestFrom()