title: How to wait for outer observable to emit a value then check for condition before subscribing to another observable once?
body: <pre><code>const subscription: Subscription;
  const first$      // Observable A
  const second$     // Observable B
  
  // When `first$` emits, I am checking the value and 
  // subscribe to `second$` if value is more than 5
  subscription.add(
     first$.subscribe(value =&gt; {
        if(value &gt; 5) {
            subscription.add(
               second$.subscribe((name) =&gt; console.log(name))
            );
         }
     });
  );
  </code></pre>
  
  <p><code>first$</code> may continue to emit multiple values through app life cycle (Angular). How do I make sure that <code>second$</code> do not get subscribed again after it has already been subscribed?</p>