UNPKG

@blinkk/selective-edit

Version:
23 lines 632 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Throttle = void 0; /** * Throttle events using the requestAnimationFrame. */ class Throttle { constructor(type, name) { this.running = false; window.addEventListener(type, () => { if (this.running) { return; } this.running = true; requestAnimationFrame(() => { window.dispatchEvent(new CustomEvent(name)); this.running = false; }); }); } } exports.Throttle = Throttle; //# sourceMappingURL=throttle.js.map