Hot and Cold Observables

Learn how hot and cold Observables receive and emit values.

We'll cover the following

It is always a good idea to know about the idea of data producers before trying to understand the concept of hot and cold Observables.

A hot Observable does not produce data within itself while a cold Observable produces data inside itself.

Hot Observables

An Observer that is subscribed to a hot Observable will receive the values that are emitted from the exact moment it subscribes to it. Every other Observer subscribed at that moment will receive the exact same values. This is similar to how JavaScript events work.

Mouse events and a stock-exchange ticker are examples of hot Observables. In both cases, the Observable emits values regardless of whether it has subscribers, and could already be producing values before any subscriber is listening.

Here’s an example of this:

Get hands-on with 1200+ tech skills courses.