A subject is a special type of Observable which shares a single execution path among the observers which results in a multicast (one to many).
There are four types of Subjects available based on how they behave:
- Subject – No initial value or replay available
- BehaviouralSubject – requires an initial value and emits current values to new subscribers
- AsyncSubject – Emits latest values to subscribers on completion of the async task
- ReplaySubject – replays a specified number of last values to new subscribers