Using Firebase Authentication with Angular Guards

canActivate(
    _: ActivatedRouteSnapshot,
    __: RouterStateSnapshot,
    ):|Observable<boolean|UrlTree>|Promise<boolean|UrlTree>|boolean|UrlTree {
  return firebaseUser$.pipe(
      // if there is a user, allow route activation
      // else redirect to sign in page
      map(u => u ? true : this.router.parseUrl('/signin')),
  );
}