title: Using defaultIfEmpty() still not emitting in Angular canActivate guard
body: <p>I have an observable in a service:</p>
  
  <pre><code>hasAccess$: Observable&lt;boolean&gt;;
  </code></pre>
  
  <p>This gets assigned in a separate component. It has <code>filter()</code> in it and will never emit false, only true. So if it's false it doesn't emit.</p>
  
  <p>I need to use it in a route guard. So I tried:</p>
  
  <pre><code>canActivate(
      next: ActivatedRouteSnapshot,
      state: RouterStateSnapshot): Observable&lt;boolean&gt; {
      return this.service.hasAccess$.pipe(
        defaultIfEmpty(false),
        tap(access =&gt; {
          console.log({access}); // never logs
        }),
        first()
      );
    }
  </code></pre>
  
  <ul>
  <li>I used <code>defaultIfEmpty()</code> to ensure a value is emitted</li>
  <li>I used <code>tap()</code> to log if anything happens (it doesn't)</li>
  <li>I used <code>first()</code> because observables returned in guards <em>must complete</em>.</li>
  </ul>
  
  <p>I ensured <code>this.service.hasAccess$</code> gets assigned. It throws an error if it isn't because you can't pipe off undefined. There's no error. Now the weird thing is, this emits false:</p>
  
  <pre><code>return of().pipe(
    defaultIfEmpty(false),
    tap(access =&gt; {
      console.log({access});
    }),
    first()
  );
  </code></pre>
  
  <p>Both are piped to <code>defaultIfEmpty(false)</code>. Why isn't the guard emitting?</p>
  
  <p><strong>Update</strong>: Thanks to @martin for pointing out that <code>defaultIfEmpty()</code> only emits on completion. Also I realize now that <code>first()</code> won't make it complete if it doesn't emit anything. I guess I need to figure out how to make it complete when it doesn't emit anything.</p>