title: Get the value of a BehaviorSubject
body: <p>I am attempting to get the values of a BehaviorSubject. The values are returned but how to i utilized them to use them in a return true/false statement. </p>
  
  <pre><code>BehaviorSubject {_isScalar: false, observers: Array(0), closed: false, isStopped: false, hasError: false, …}
  closed:false
  hasError:false
  isStopped:false
  observers:[Subscriber]
  thrownError:null
  value:(...)
  _isScalar:false
  _value:Array(3)
  0:"name@gmail.com"
  1:"Bob Smith"
  2:{adminUser: false, basicUser: true} length:3
  __proto__:Array(0)
  __proto__:Subject
  </code></pre>
  
  <p>My Behavior Subject has the following being sent to it. Why am i getting null at the start. </p>
  
  <pre><code>user: BehaviorSubject&lt;User&gt; = new BehaviorSubject&lt;User&gt;(null); 
  </code></pre>
  
  <p>// The behavior-roles of the user.</p>
  
  <pre><code> this.afAuth.authState
                  .switchMap(auth =&gt; {
                  if (auth) {
                      /// signed in
                      const authData = this.db.list&lt;User&gt;('users/' + auth.uid).valueChanges();
                      console.log(authData);
                      return this.db.list&lt;User&gt;('users/' + auth.uid).valueChanges();
                  } else {
                      /// not signed in
                      return Observable.of(null);
                  }
                  })
                  // .subscribe(console.log); // check the subscription
                  .subscribe((userData) =&gt; {
                  console.log(userData);
                  this.user.next(userData);
                  // this.user.next(user);
                  // console.log(this.user.next(userData));
                  });
              }
  </code></pre>
  
  <p>The results i am having issues with:</p>
  
  <pre><code>Check Value false authguard.service.ts:39 
  Route was False authguard.service.ts:26 
  Check Value true
  </code></pre>
  
  <p>I run console.log and the value shows up null first therefore has a false response. Then it runs again and becomes true. This all happens after running the page initially. I need for my check value to be true on load. </p>