MENU

Fun & Interesting

Subjects in RxJS | Observables | Angular 12+

procademy 60,624 lượt xem 3 years ago
Video Not Working? Fix It Now

In this lecture, let's learn what is a subject in RxJS. A Subject is a special type of Observable that allows values to be multicasted to many Observers. Subjects are like EventEmitters.

We mostly use subjects to perform cross component communication. We can communicate between two or more components which are not related, using subjects. We have already achieved the same thing using service and EventEmitter. Now, let's try it with service and Subject.

Subjects: https://rxjs.dev/api/index/class/Subject

Comment