Loading topic
new Observable(...). That works, but you will rarely need it in practice. RxJS ships creation functions that wrap common sources for you: fixed values, arrays, promises, DOM events, and timers. Each one produces a correctly behaved obser5 min readpipe. This chapter covers how pipe buil4 min readngOnInit and ngOnDestroy. It also assumes you know dependency injection with inject() and the observable, observer, and subscription model from the first chapter. You will learn when a subscription must be closed, the5 min read@if, @for). Here we hand subs5 min readHttpClient returns observables instead of Promises. That choice affects when requests are sent, how many times they are sent, and how you cancel them. This chapter explains how an HttpClient observable behaves, how to configure requests and read responses, and which mistakes come up mo4 min readpipe, map, and tap, and how to call HttpClient from a service. It covers what happens to a stream when something fails, how to replace a failed stream with catchError, how to try again with retry, and how to combine the tw5 min readpipe and basic operators such as map work, how HttpClient returns observables, and how catchError recovers from errors. It also uses takeUntilDestroyed, which an earlier chapter covered.4 min readvalueChanges stream. Each operator in the pipeline handles one specific problem.5 min readrouterLink. It also assumes you can read a pipe chain with map and filter, have seen switchMap cancel an earlier request, and know how the async pipe and takeUntilDestroyed manage a subscription. Earlier chapters covered5 min readpipe with basic operators and know why unsubscribing matters. You should be comfortable with Angular services and dependency injection.5 min readSubject and ReplaySubject work. It explains why some observables do their work again for every subscriber while others don't, and how to control that behavior with share and `shar4 min readpipe, basic operators, the flattening operators from the switchMap chapter, and the debounced search pattern. It also assumes you can run a Jest or Jasmine spec in an Angular project. The examples use Jest-style expect(...).toEqual(...), which also works i5 min read