<button>Show</button>
<output></output>

import { fromEvent } from "https://cdn.skypack.dev/rxjs@7.3.0";
import { bufferCount } from "https://cdn.skypack.dev/rxjs@7.3.0/operators";

const output = document.querySelector("output");
const button = document.querySelector("button");

fromEvent(button, "click")
  .pipe(bufferCount(3))
  .subscribe(() => {
    output.textContent = Math.random().toString(36).slice(2);
  });

Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.