title: error in canActivate guard method
body: <p>Below is my implementation of CanActivate guard clause in TypeScript , when I compile this  code , it shows below error</p>
  
  <blockquote>
    <p>A function whose declared type is neither 'void' nor 'any' must return a value</p>
  </blockquote>
  
  <pre><code>   canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot):boolean {
  
       this.appService.isValidUser().subscribe({
          next: (data) =&gt; data.authenticated, // this return true or false
          error: (err) =&gt; false
      });
  }
  </code></pre>
  
  <p>What is the reason for this error ?</p>