title: Shared observable and startWith operator
body: <p>I have a question regarding multicasted observables and an unexpected (for me) behaviour I noticed.</p>
  
  <pre><code>const a = Observable.fromEvent(someDom, 'click')
    .map(e =&gt; 1)
    .startWith(-1)
    .share();
  
  const b = a.pairwise();
  
  a.subscribe(a =&gt; {
    console.log(`Sub 1: ${a}`);
  });
  
  a.subscribe(a =&gt; {
    console.log(`Sub 2: ${a}`)
  });
  
  b.subscribe(([prevA, curA]) =&gt; {
    console.log(`Pairwise Sub: (${prevA}, ${curA})`);
  });
  </code></pre>
  
  <p>So, there is a shared observable a, which emits 1 on every click event. -1 is emitted due to the startWith operator.
  The observable b just creates a new observable by pairing up latest two values from a.</p>
  
  <p>My expectation was:</p>
  
  <pre><code>[-1, 1] // first click
  [ 1, 1] // all other clicks
  </code></pre>
  
  <p>What I observed was:</p>
  
  <pre><code>[1, 1] // from second click on, and all other clicks
  </code></pre>
  
  <p>What I noticed is that the value -1 is emitted immediately and consumed by Sub 1, before even Sub 2 is subscribed to the observable and since a is multicasted, Sub 2 is too late for the party.</p>
  
  <p>Now, I know that I could multicast via BehaviourSubject and not use the startWith operator, but I want to understand the use case of this scenario when I use startWith and multicast via share.</p>
  
  <p>As far as I understand, whenever I use .share() and .startWith(x), only one subscriber will be notified about the startWith value, since all other subscribers are subscribed after emitting the value.</p>
  
  <p>So is this a reason to multicast via some special subject (Behavior/Replay...) or am I missing something about this startWith/share scenario?</p>
  
  <p>Thanks!</p>