title: How to call "defaultIfEmpty" when list is empty on RxJS?
body: <p>I've two lists with two distinct objects that need to be converted into the same type, the &quot;second&quot; list will be used only if the &quot;first&quot; list is empty, I tried to use the method <code>defaultIfEmpty</code> but it never return the second option.</p>
  <pre><code>const first = []; // could be [{code: 1}, {code: 2}]
  const second = [{id: 1}, {id: 2}]
  
  of(first).pipe(
      map((value) =&gt; {number: value.code})
  ).pipe(
      defaultIfEmpty(of(second).pipe(map((value) =&gt; {number: value.id})))
  ).subscribe(doSomething);
  </code></pre>
  <p>The desired output is:</p>
  <pre><code>[{number: 1}, {number: 2}]
  </code></pre>
  <p>On the example above, the <code>map</code> from <code>defaultIfEmpty</code> is never called;</p>
  <ol>
  <li>how can I &quot;switch&quot; to another method source if the given source is empty?</li>
  <li>will <code>subscribe</code> method be called after the <code>map</code> is complete, or it will be called for each item on <code>map</code>?</li>
  </ol>