title: Is there a logical-or-type operator in rxjs?
body: <p>I have an angular service where I want to expose an observable which acts as logical 'or' of sorts. Say I have multiple source sequences which can give <code>on</code> and <code>off</code> values. I need to output <code>true</code> any time anything is <code>on</code>, and go back to <code>false</code> when all values are <code>off</code>.</p>
  
  <p>Example:</p>
  
  <pre><code>const replaceInput = input =&gt; input === 'on' ? 'off' : 'on';
  const getSource = (name) =&gt; Observable.interval(1000)
      .scan(
          input =&gt; Math.random() &gt; 0.5 ? replaceInput(input) : input,
          'off' // initial value
      )
      .do(val =&gt; console.log(`${name}: ${val});
  
  const first$ = getSource('first');
  const second$ = getSource('second');
  const result$ = ???;
  </code></pre>
  
  <p>Now, I've tried with <code>result$ = Observable.merge(first$, second$)</code>, but that gives always <code>on</code>. I have also tried with <code>result$ = combineLatest(first$, second$)</code>, so that is somewhat ok, but my inputs are out of sync, so it's not always perfect. I mean, first$ may emit more than one value while second may never fire and the other way around. What else can I do?</p>
  
  <p>I've thought of some mergeMap or similar, and then keeping the state on the outside context, that way I run updates on any event. But then I get into a problem, an 'off' event might mean 'off', but only if other sequences are also 'off', so it gets tricky quickly.</p>