title: How to wait for the last keystroke before executing a function in Angular?
body: <p>I have following input:</p>
  <pre><code> &lt;input type=&quot;text&quot; placeholder=&quot;Search for new results&quot; (input)=&quot;constructNewGrid($event)&quot; (keydown.backslash)=&quot;constructNewGrid($event)&quot;&gt;
  </code></pre>
  <p>and the function</p>
  <pre><code>constructNewGrid(e){
      // I want to wait 300ms after the last keystroke before constructing the new grid
      // If the passed time is &lt;300ms just return without doing something
      // else start constructing new grid
  }
  </code></pre>
  <p>I am not quite sure how to build such a condition. How should I approach this problem?
  I read about debounceTime in RxJS which exactly what I want but I do not use observables in the function, so: How would you build such a condition in your function?</p>