title: In RxJS, why does a pipe get executed once for each subscription?
body: <p>I want to have multiple subscriptions to react to an observable event, but I want to log the event as well, so I pipe it through a <code>do()</code> operator in which I do the logging.</p>
  
  <p>The problem is, the event gets logged once for each of the subscriptions I create!</p>
  
  <p>I'm getting around this at the moment by creating a <code>Subject</code> and calling <code>next</code> on it from an event callback, which allows me to log the event once and trigger multiple subscriptions as well.</p>
  
  <p>Here is some code that demonstrates the issue: <a href="https://stackblitz.com/edit/rxjs-xerurd" rel="noreferrer">https://stackblitz.com/edit/rxjs-xerurd</a></p>
  
  <p>I have a feeling I'm missing something, isn't there a more "RxJS" way of doing this?</p>
  
  <p>EDIT:</p>
  
  <p>I'm not asking for a difference between hot &amp; cold observable, in fact I was using a hot observable - the one created by <code>fromEvent()</code> and was wondering why does my presumably hot event source behave like it's cold. </p>
  
  <p>I realize now - after reading about <code>share()</code> - that <code>pipe()</code> "turns" your observable cold i.e. returns a cold one based on the your source (which may be cold, may be hot)</p>