MCPcopy Create free account
hub / github.com/Autodesk/react-base-table / debounce

Function debounce

src/utils.js:185–191  ·  view source on GitHub ↗
(fn, ms = 0)

Source from the content-addressed store, hash-verified

183
184// copied from https://www.30secondsofcode.org/js/s/debounce
185export const debounce = (fn, ms = 0) => {
186 let timeoutId;
187 return function(...args) {
188 clearTimeout(timeoutId);
189 timeoutId = setTimeout(() => fn.apply(this, args), ms);
190 };
191};
192
193// copied from https://www.30secondsofcode.org/js/s/throttle
194export const throttle = (fn, wait) => {

Callers 2

constructorMethod · 0.90
CodeEditorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected