title: Property 'mergeMap' does not exist on type 'Observable<any>'
body: <p>I'm creating an HttpInterceptor in an <strong>Ionic 4</strong> app. I would like to read the Bearer Authorization token from <a href="https://ionicframework.com/docs/building/storage" rel="nofollow noreferrer">local storage</a>.</p>
  
  <p>I try to use mergeMap but it always return an error:</p>
  
  <pre><code>Property 'mergeMap' does not exist on type 'Observable&lt;any&gt;'
  </code></pre>
  
  <p>Here is the complete code from <em>token.interceptor.ts</em></p>
  
  <pre><code>import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor, HttpResponse, HttpErrorResponse } from '@angular/common/http';
  import { Injectable } from '@angular/core';
  import { Observable, throwError, from  } from 'rxjs';
  import { map, catchError } from 'rxjs/operators';
  import { Router } from '@angular/router';
  import { Storage } from '@ionic/storage';
  
  @Injectable()
  export class TokenInterceptor implements HttpInterceptor {
  
      token: any;
  
      constructor(private router: Router, private storage: Storage) {}
  
      intercept(request: HttpRequest &lt; any &gt; , next: HttpHandler): Observable &lt; HttpEvent &lt; any &gt;&gt; {
  
          return from(this.storage.get('User')).mergeMap((val) =&gt; {
              if (this.token) {
                  request = request.clone({
                      setHeaders: {
                          'Authorization': this.token
                      }
                  });
              }
  
              if (!request.headers.has('Content-Type')) {
                  request = request.clone({
                      setHeaders: {
                          'content-type': 'application/json'
                      }
                  });
              }
  
              request = request.clone({
                  headers: request.headers.set('Accept', 'application/json')
              });
  
              return next.handle(request).pipe(
                  map((event: HttpEvent &lt; any &gt; ) =&gt; {
                      if (event instanceof HttpResponse) {
                          console.log('event---&gt;&gt;&gt;', event);
                      }
                      return event;
                  }),
                  catchError((error: HttpErrorResponse) =&gt; {
                      if (error.status === 401) {
                          if (error.error.success === false) {
                              // this.presentToast('Login failed');
                          } else {
                              this.router.navigate(['/']);
                          }
                      }
                      return throwError(error);
                  }));
          })
  
      }
  
  }
  </code></pre>
  
  <p>According to <a href="https://stackoverflow.com/questions/50138201/mergemap-does-not-exist-on-type-observable">this question</a>, I tried this format:</p>
  
  <pre><code>return from(...).pipe(mergeMap(...));
  </code></pre>
  
  <p>but it doesn't work.</p>
  
  <p>What should I try?</p>