26 lines
693 B
HTML
26 lines
693 B
HTML
<!DOCTYPE html>
|
|
<head>
|
|
<title>Forum Graph: Debounce test</title>
|
|
<link type="text/css" rel="stylesheet" href="/index.css" />
|
|
</head>
|
|
<body>
|
|
<div id="debounce-test"></div>
|
|
</body>
|
|
<script type="module">
|
|
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);
|
|
</script>
|