BehaviorSubject is the last example that we will cover. This Subject saves the last emitted value and, whenever there is a new subscriber, it emits that value and keeps emitting new values that it receives until the upstream completes. In the following figure, we can see that the BehaviorSubject is being created with a default value of a purple marble:

Next, we can see a subscription that's denoted with a blue dashed line. When the subscription happens, the current last saved value is emitted and, in this case, it's a purple marble.
Afterwards, the Subject relays all the marbles to the following first Observable (Subscription) that's denoted with a first solid line of the following:

We can also see a second subscribe happening, which will emit a green marble to the new Observable this time because, at the time, it was the last current value.
The blue marble was relayed to both Observables and when the Subject completed, it can be seen from the termination symbol.