Reactive programming, Observables and Observers
Learn Reactive programming, Observables and Observers (Module 12 · RxJS, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Streams over time • Reactive programming means describing what should happen when data arrives, instead of asking for it. Compare a Java List (all values exist now) with a stream of events (values arrive over time): clicks, keystrokes, HTTP responses. • RxJS (Reactive Extensions for JavaScript) is the library that models these as Observables . Angular uses it in HttpClient, Router, forms and more. • An Observable is a lazy stream, like a YouTube channel: nothing happens until someone subscribes. The Observer is the subscriber with three callbacks: next (a value), error (failed) and complete...
More lessons in Module 12 · RxJS
- Module 12 overview and checklist
- Subjects: Subject, BehaviorSubject, ReplaySubject, AsyncSubject
- Operators: categories and everyday operators
- Higher-order observables: switchMap, mergeMap, concatMap, exhaustMap
- Combining streams and sharing results
- Error handling, completion and subscription management
- AsyncPipe, Signals interop, testing and choosing operators