Files
nodecg-venue-gfx/scripts/debounce.mjs
T
dvdrw 4bb64a8ca3 init: initial commit
- ticker / QR ad overlay / break slide graphics (1920×1080) with all
  geometry derived from one shared module (src/shared/obs-geometry.mjs)
- OBS scene-collection generator (scripts/generate-obs-scenes.mjs) and a
  read-only in-dashboard setup verifier, both driven by the same module
- en/sr dashboard i18n selected via bundle config; configschema.json with
  neutral first-run defaults seeded from optional branding config
- install.sh / systemd user service / update.sh for venue deployment
- reference OBS scene collection + profile from a real venue as fixtures
2026-07-15 19:30:32 +02:00

20 lines
384 B
JavaScript

const timers = new Map();
/**
* A standard debounce, but uses a string `name` as the key instead of the callback.
*/
export default function (name, callback, duration = 500) {
const existing = timers.get(name);
if (existing) {
clearTimeout(existing);
}
timers.set(
name,
setTimeout(() => {
timers.delete(name);
callback();
}, duration),
);
}