So far, we have been describing and discussing cold Observables and hot Observables, but there is a third kind: the warm Observable. A warm Observable can be thought of as being created as a cold Observable, but turning into a hot Observable under certain conditions. Let's look at such a case by introducing the refCount() operator:
// hot-cold-warm/warm-observer.jsconst Rx = require("rxjs/Rx");let warmStream = Rx.Observable.interval(1000).take(3).publish().refCount();let start = new Date();setTimeout(() => { warmStream.subscribe(data => { console.log(`subscriber 1 - ${new Date() - start}`,data); });}, 2000);
OK, so we started to use the operator publish(), and it looks like we are about to use our connect() operator and that ...