MCPcopy
hub / github.com/microsoft/SandDance / debounce

Function debounce

docs/app/js/sanddance-app.js:106793–106799  ·  view source on GitHub ↗
(delay, handler)

Source from the content-addressed store, hash-verified

106791 return isFunction(_) ? _ : ()=>_;
106792}
106793function debounce(delay, handler) {
106794 let tid;
106795 return (e)=>{
106796 if (tid) clearTimeout(tid);
106797 tid = setTimeout(()=>(handler(e), tid = null), delay);
106798 };
106799}
106800function extend(_) {
106801 for(let x, k, i = 1, len = arguments.length; i < len; ++i){
106802 x = arguments[i];

Callers

nothing calls this directly

Calls 4

handlerFunction · 0.70
streamFunction · 0.70
addMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected