1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-02 12:42:15 +02:00

🔤 adds debugging

This commit is contained in:
2025-03-04 15:31:21 +01:00
parent 56232a9f64
commit 4edc509646
8 changed files with 384 additions and 9 deletions

View File

@ -0,0 +1,15 @@
import { S } from "deka-dom-el/signals";
// Debouncing signal updates
function debounce(func, wait) {
let timeout;
return (...args)=> {
clearTimeout(timeout);
timeout= setTimeout(() => func(...args), wait);
};
}
const inputSignal= S("");
const debouncedSet= debounce(value => inputSignal.set(value), 300);
// In your input handler
inputElement.addEventListener("input", e=> debouncedSet(e.target.value));