Subjects: Subject, BehaviorSubject, ReplaySubject, AsyncSubject
Learn Subjects: Subject, BehaviorSubject, ReplaySubject, AsyncSubject (Module 12 · RxJS, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Subjects: an observable you can push into • A Subject is both an Observable (others subscribe) and an Observer (you call next() ). Think of a radio station : one broadcaster, many listeners; listeners only hear what is broadcast after they tune in. • Subjects are multicast : all subscribers share one execution. Typical use: a service that broadcasts events to components.
More lessons in Module 12 · RxJS
- Module 12 overview and checklist
- Reactive programming, Observables and Observers
- 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