MCPcopy Create free account
hub / github.com/ChinaGodMan/UserScripts / debounce

Function debounce

github-gist-copier/github-gist-copier.user.js:126–136  ·  view source on GitHub ↗
(f, delay)

Source from the content-addressed store, hash-verified

124 const compactGist = true
125 function noop() { }
126 function debounce(f, delay) {
127 let timeoutId = null
128 return function (...args) {
129 if (timeoutId) {
130 clearTimeout(timeoutId)
131 }
132 timeoutId = setTimeout(() => {
133 f.apply(this, args)
134 }, delay)
135 }
136 }
137
138 function createCopyButton(fileElement) {
139 const fileActionElement = fileElement.querySelector('.file-actions')

Callers 1

runGistFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected