16 lines
452 B
JavaScript
16 lines
452 B
JavaScript
import { Box } from './classes/box.js';
|
|
import { Scene } from './classes/scene.js';
|
|
import { debounce, delay } from './util.js';
|
|
|
|
const rootElement = document.getElementById('debounce-test');
|
|
const rootBox = new Box('rootBox', rootElement).flex();
|
|
|
|
const scene = window.scene = new Scene('Debounce test', rootBox);
|
|
|
|
const log = () => scene.log('event');
|
|
debounce(log, 500);
|
|
debounce(log, 500);
|
|
await delay(500);
|
|
debounce(log, 500);
|
|
debounce(log, 500);
|