Reactive Everything: Multicasting

Learn how to share the same underlying source with multiple observers.

Using .publish()

The simplest mechanism to convert a given cold Observable to a hot Observable is by using the method .publish(). Calling .publish() returns a ConnectableObservable, which is a special type of Observable wherein each Observer shares the same underlying resource. In other words, using .publish(), we are able to multicast, or share to multiple observers.

Get hands-on with 1200+ tech skills courses.