title: How to add debounce time to in input search box in typescript?
body: <p>How can i add debounce time to dynamic search box that searches data on table data ? I have looked at some solution on the site but my code is little bit different, I do not use any throttle or something else so I am just confused.</p>
  
  <p>my template code:</p>
  
  <pre><code>&lt;input matInput (keyup)="applyFilter($event.target.value)" placeholder="Search element"&gt;
  </code></pre>
  
  <p>and typescript for that is:</p>
  
  <pre><code>applyFilter(filterValue: string) {
      this.tableDataSource.filter = filterValue.trim().toLowerCase();
  }
  </code></pre>
  
  <p>I want to add debounce time for that the search will be made every 2 seconds and not sending lots of request for every change.</p>
  
  <p>Thanks in advance</p>
  
  <p>I have tried to call the method from another method with pipe</p>
  
  <pre><code>filterData(filterValue: string) {
      this.applyFilter(filterValue).pipe(debounceTime(2000))
  }
  </code></pre>
  
  <p>but now it says, <em>pipe does not exist on type void</em></p>