title: Angular + Rxjs operator - show loader if api not completed within 5 sec show toastr and hide loader
body: <p>Actually we are trying to avoid blocking user to do other operation while file upload in progress.</p>
  <p>how can i show toastr and hide the loader if api is not completed with in 5 sec using rxjs in angular.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>uploadFile() {
    this.service.uploadFile(data)
      .pipe(
        //i am looking for operator which will wait 5 sec if and then hide the loader and show the toastr
      )
      .subscribe(() =&gt; {
        this.toastr.success('file uploaded successfully');
        this.loader.hide();
      })
  }</code></pre>
  </div>
  </div>
  </p>
  <p>thanks in advance</p>