title: Returning value from BehaviorSubject in angular 6 guard
body: <p>I'm going this direction because i've another guard who is validating the user on the token previously stored. This is what i was doing in previous version of rxjs, now in the latest you cant map on the subject.</p>
  
  <pre><code>canActivate(next: ActivatedRouteSnapshot,
             state: RouterStateSnapshot): Observable&lt;boolean&gt; | Promise&lt;boolean&gt; | boolean {
    return this.authservice.behaviorsubject().map(x =&gt; {
      if (x) {
        return true;
      } else {
        return false;
      }
    })
  }
  </code></pre>
  
  <p>I need any guidence how to get this thing working. I've tried somting like this but wont return anything since never subscribed to it (and also its not a Observable its a AnonymusSubject when i console.log it)</p>
  
  <pre><code>canActivate(next: ActivatedRouteSnapshot,
             state: RouterStateSnapshot): Observable&lt;boolean&gt; | Promise&lt;boolean&gt; | boolean {
    return this.authservice.behaviorsubject().pipe(
      map(x =&gt; {
        if (x) {
          return true;
        } else {
          return false;
        }
      })
    )
  }
  </code></pre>
  
  <p>Also tried converting it into observable with Observable.create() but wont work.
  I know im missing something.
  Heeeeelp :)</p>