Explaining Multicasting versus Unicasting
Before hitting the concept of Multicasting, let's understand what Producer means.
Producer
Let's start by explaining the concept of Producer, which we will be using a lot in this chapter.
We call Producer the source of values of the Observable – for example, DOM events, WebSockets, and HTTP requests are regarded as Producers. Basically, it is any data source used to get values.
Observables basically fall into two types – hot and cold Observables. Let's understand the difference between them.
A cold observable
An observable is called cold when the data emitted is created by the Observable itself. The producer of the data is then created inside the observable itself. This is an example of a cold Observable:
import { Observable} from 'rxjs'; const coldObservable$ = new Observable(observer => { observer.next(Math.random()); observer.next(Math.random());...