Loading topic
HttpClient, reactive forms, and the router. This chapter covers the model behind all of them. An observable is a function that sets up a producer. The producer pushes values to an observer, and a subscription lets you stop it.2 min readnew Observable(). In practice you rarely do that. RxJS ships creation functions, which are factory functions that wrap a common data source in an observable for you. This chapter assumes you know TypeScript generics, arrow functions, Promises, 2 min readpipe. It also assumes you are comfortable with Angular services, standalone components, and dependency injection.2 min readpipe, basic operators such as map, and how HttpClient returns an observable for each request. It explains what happens when a stream fails and how to recover with catchError and retry.2 min readpipe with map and filter, and that you have seen HttpClient return an observable. It covers the case where each value from one stream has to start another async task, such as an HTTP request.2 min readFormControl, ReactiveFormsModule), the async pipe, and how switchMap cancels an earlier inner observable when a new value arrives. Here those pieces come together in a search box that sends few requests and never shows stale results.2 min readswitchMap (covered earlier), and clean up subscriptions with takeUntilDestroyed or the async pipe.2 min readpipe, map, the async pipe, takeUntilDestroyed, and how HttpClient returns observables. These three functions let you merge several streams into one, and each follows a different rule for when it emits.2 min readsubscribe call. It also assumes you are comfortable with TypeScript generics.2 min readHttpClient returns observables, and how a Subject pushes values to many subscribers.2 min readBehaviorSubject is, how the async pipe subscribes in templates, and how pipe and map derive new streams. Here you combine those pieces into one pattern: a service that owns2 min readsignal, computed, and reading a signal by calling it). It also assumes you have read the earlier chapters on subscription lifecycle and observable-based state services. Signals hold a current value and update templates directly. Observables model ev2 min readpipe, map, and the flattening operators from earlier chapters, and that your project already runs unit tests with Jasmine or Jest. Testing streams with real timers is slow and flaky. RxJS solves this with TestScheduler, which runs streams on virtual time and descr2 min read