What is multicasting?

Technology CommunityCategory: AngularWhat is multicasting?
VietMX Staff asked 3 years ago

Multi-casting is the practice of broadcasting to a list of multiple subscribers in a single execution. Let’s demonstrate the multi-casting feature,

    var source = Rx.Observable.from([1, 2, 3]);
    var subject = new Rx.Subject();
    var multicasted = source.multicast(subject);

    // These are, under the hood, `subject.subscribe({...})`:
    multicasted.subscribe({
      next: (v) => console.log('observerA: ' + v)
    });
    multicasted.subscribe({
      next: (v) => console.log('observerB: ' + v)
    });

    // This is, under the hood, `s