It takes a key, signals to be called, and a timeout.
Each time b.debounce() is called with a given
key the timeout is reset to specified value.
You can click the button in this snippet multiple times.
It only increments the counter once per time
the debounce is allowed to finish and resolves.
html
<buttondata-s="start"data-r="end">Start</button>
javascript
exportconstb={};letcount=0;exportfunctionstart(ev,__,el){ev.target.innerHTML="waiting for debounce to resolve";b.debounce("snippet","end",2000);}exportfunctionend(_,__,el){count+=1;el.innerHTML=`debounce has resolved to count ${count}`;}