title: How can I add a debounce to a button using RXJS?
body: <p>I want to add a timeout/debounce to pagination buttons, so that when you spam the button, it only executes once instead of the spammed times.</p>
  <p>My current code is following but does not work:</p>
  <pre><code>  onNextPage(): void {
  
      of(&quot;dummy&quot;).pipe(
        exhaustMap(this.increasePage)
      )
  
    }
  
    increasePage() {
      return new Promise(resolve =&gt; {
        this.page++
        this.onViewPage()
        resolve(true)
      })
    }
  </code></pre>