title: RXJS RetryWhen - continue error downstream while attempting retry
body: <p>The steps:</p>
  
  <ol>
  <li><p>I have a source stream (observable) that is a web socket connection. </p></li>
  <li><p>When the connection is disconnected or errors the source emits a error on the stream.</p></li>
  <li><p>Downstream from the source I use <code>retryWhen</code> to attempt a reconnect to the web socket connection after every x seconds. </p>
  
  <ul>
  <li>Up to this point everything works as I want.</li>
  </ul></li>
  <li><p>Further downstream I have a <code>catchError</code> that sets a default value. This allows the application to know the up-to-date status of the connection.</p></li>
  </ol>
  
  <p>Example code (a very simplistic example of my code):</p>
  
  <pre><code>connect(): Observable&lt;any&gt; {
    return this.websocket() // source stream that errors when it disconnects
      .pipe(
        retryWhen( errors =&gt; 
          errors.pipe(
           delay( 2000 ) // delay retry
          )
        )
      )
  }
  
  connectionStatus(): Observable&lt;boolean&gt;{
    return this.connect().pipe(
      catchError( () =&gt; of( false ) ), // this does not trigger with the retryWhen
      map( () =&gt; true )
    )
  }
  </code></pre>
  
  <p>The problem:</p>
  
  <p>I want the downstream subscribers to know that it's disconnected while it is attempting the <code>retryWhen</code>. However, the downstream <code>catchError</code> is not triggered while <code>retryWhen</code> is happening.</p>
  
  <p>Any ideas how I can attempt re-connecting for all subscribers (not just the connectionStatus), but also when notify downstream when the connection is down (errors).</p>
  
  <p>After re-connecting I want to continue streaming to all subscribers like nothing has happened.</p>
  
  <p>Let me know if anything is unclear.</p>