title: Return Observable<boolean> from service method after two subscriptions resolve
body: <p>I'm trying to setup a simple way to compare the current username with a profile's username within an Angular service.</p>
  
  <p>Obviously the profile username and the user's username must resolve before I can compare them so how do I return a boolean observable so that I can subscribe to this comparison within components?</p>
  
  <p>This is where I'm at:</p>
  
  <pre><code>public profileId = new Subject&lt;string&gt;; // Observable string source updated from a profile.component (when the URL displays the profile's username)
  public profileId$ = this.profileId.asObservable();
  public currentUser = this.principal.asObservable().distinctUntilChanged();
  
  public isProfileOwner(): Observable&lt;boolean&gt; { // A function whose declared type is neither 'void' nor 'any' must return a value.
      this.currentUser.subscribe(user =&gt; {
              this.profileId$.subscribe(
                  profile =&gt; {
                      console.log(profile + ' ' + user.username); // match!
                      if (profile === user.username) {
                          return Observable.of(true);
                      } else {
                          return Observable.of(false);
                      }
                  }
              )
          })
  }
  </code></pre>
  
  <p>This seems to be the way other SO answers explain to do it but I'm getting <code>[ts] A function whose declared type is neither 'void' nor 'any' must return a value.</code></p>
  
  <p>I'd like to subscribe to test within components.</p>
  
  <pre><code>this.authService.isProfileOwner().subscribe(
      data =&gt; {
          console.log(data); // should be boolean
      }
  )
  </code></pre>