title: Returning boolean value in an rxjs function fails
body: <p>Am new to the rxjs and i would like to return an observable of either true or false </p>
  
  <p>this is what i have tried</p>
  
  <pre><code>checkLoggedin():Observable&lt;boolean&gt; {
    //check from server if user is loggdin
    if(this._tokenService.getToken()){ //this returns synchronous true or false
  
        this._httpservice.checkifloggedin()
           .subscribe((res)=&gt;{
              return res.data //this comes in as true or false value
                },
                err=&gt;{ return false }
                )    
       }else{
  
          return false  //this fails with an error of 
                      //type false is not assignable to observable&lt;boolean&gt;
          }
  
   }
  </code></pre>
  
  <p>How do i change the above else part to work with the boolean observable so that in the other components i can only do</p>
  
  <pre><code>this._authservice.checkLoggedin()
    .subscribe.....//here get the value whether true or false
  </code></pre>