title: How can I get a response from an observable immediately?
body: <p>I need to know if the user is signed in, but when I check, the AngularFireAuth hasn't given a response yet, and so it thinks I'm not signed in when I am.</p>
  
  <p>My service:</p>
  
  <pre><code>loggedIn = false;
  
  constructor(private afAuth: AngularFireAuth) {
    this.afAuth.authState.subscribe(user=&gt;{
      this.loggedIn = true;
    });
  }
  </code></pre>
  
  <p>then I have my Guard:</p>
  
  <pre><code>@Injectable()
  export class OnlyLoggedInUsersGuard implements CanActivate {
  
    constructor(private user: UserService) {}
  
    canActivate(){
        return this.user.loggedIn? true:false;
    }
  </code></pre>
  
  <p>When I try to open the dashboard it says I'm not logged in, because it's checking after the service is constructed, but before the observable is changing <code>loggedIn</code> to true.</p>